//Vehicles module.
//Created by Iain Gilbert, modified by GTO Dev Team.
//Modder: MadCat

#include "base"
#include "player"

new bool:CarHaveNOS[MAX_VEHICLES];

#define MAX_VEHICLE_MODELS 66
#define MAX_DEFAULT_VEHICLE_SPAWNS 673 // 18 more at derby, 6 at dirtbike, 3 - businesses trucks

#if SAVE_VEHICLES_IN_DB
new SplitDiv[26][MAX_DEFAULT_VEHICLE_SPAWNS];
new TimerVehicles;
#endif

#define V_ADMIRAL 445
#define V_ALPHA 602
#define V_AMBULAN 416
#define V_ANDROM 592            // air
#define V_ARTICT1 435
#define V_ARTICT2 450
#define V_ARTICT3 591
#define V_AT400 577             // air
#define V_BAGBOXA 606
#define V_BAGBOXB 607
#define V_BAGGAGE 485
#define V_BANDITO 568
#define V_BANSHEE 429
#define V_BARRACKS 433
#define V_BEAGLE 511            // air
#define V_BENSON 499
#define V_BF400 581             // bike
#define V_BFINJECT 424
#define V_BIKE 509              // bike
#define V_BLADE 536
#define V_BLISTAC 496
#define V_BLOODRA 504
#define V_BMX 481               // bike
#define V_BOBCAT 422
#define V_BOXBURG 609
#define V_BOXVILLE 498
#define V_BRAVURA 401
#define V_BROADWAY 575
#define V_BUCCANEE 518
#define V_BUFFALO 402
#define V_BULLET 541
#define V_BURRITO 482
#define V_BUS 431
#define V_CABBIE 438
#define V_CADDY 457
#define V_CADRONA 527
#define V_CAMPER 483
#define V_CARGOBOB 548          // air
#define V_CEMENT 524
#define V_CHEETAH 415
#define V_CLOVER 542
#define V_CLUB 589
#define V_COACH 437
#define V_COASTG 472            // water
#define V_COMBINE 532
#define V_COMET 480
#define V_COPBIKE 523           // bike
#define V_COPCARLA 596
#define V_COPCARRU 599
#define V_COPCARSF 597
#define V_COPCARVG 598
#define V_CROPDUST 512          // air
#define V_DFT30 578
#define V_DINGHY 473            // water
#define V_DODO 593              // air
#define V_DOZER 486
#define V_DUMPER 406
#define V_DUNERIDE 573
#define V_ELEGANT 507
#define V_ELEGY 562
#define V_EMPEROR 585
#define V_ENFORCER 427
#define V_ESPERANT 419
#define V_EUROS 587
#define V_FAGGIO 462
#define V_FARMTR1 610
#define V_FBIRANCH 490
#define V_FBITRUCK 528
#define V_FCR900 521            // bike
#define V_FELTZER 533
#define V_FIRELA 544
#define V_FIRETRUK 407
#define V_FLASH 565
#define V_FLATBED 455
#define V_FORKLIFT 530
#define V_FORTUNE 526
#define V_FREEWAY 463           // bike
#define V_FREIBOX 590
#define V_FREIFLAT 569
#define V_FREIGHT 537
#define V_GLENDALE 466
#define V_GLENSHIT 604
#define V_GREENWOO 492
#define V_HERMES 474
#define V_HOTDOG 588
#define V_HOTKNIFE 434
#define V_HOTRINA 502
#define V_HOTRINB 503
#define V_HOTRING 494
#define V_HUNTER 425            // air
#define V_HUNTLEY 579
#define V_HUSTLER 545
#define V_HYDRA 520             // air
#define V_INFERNUS 411
#define V_INTRUDER 546
#define V_JESTER 559
#define V_JETMAX 493            // water
#define V_JOURNEY 508
#define V_KART 571
#define V_LANDSTAL 400
#define V_LAUNCH 595            // water
#define V_LEVIATHN 417          // air
#define V_LINERUN 403
#define V_MAJESTIC 517
#define V_MANANA 410
#define V_MARQUIS 484           // water
#define V_MAVERICK 487          // air
#define V_MERIT 551
#define V_MESA 500
#define V_MONSTER 444
#define V_MONSTERA 556
#define V_MONSTERB 557
#define V_MOONBEAM 418
#define V_MOWER 572
#define V_MRWHOOP 423
#define V_MTBIKE 510            // bike
#define V_MULE 414
#define V_NEBULA 516
#define V_NEVADA 553            // air
#define V_NEWSVAN 582
#define V_NRG500 522            // bike
#define V_OCEANIC 467
#define V_PACKER 443
#define V_PATRIOT 470
#define V_PCJ600 461            // bike
#define V_PEREN 404
#define V_PETRO 514
#define V_PETROTR 584
#define V_PHOENIX 603
#define V_PICADOR 600
#define V_PIZZABOY 448
#define V_POLMAV 497            // air
#define V_PONY 413
#define V_PREDATOR 430          // water
#define V_PREMIER 426
#define V_PREVION 436
#define V_PRIMO 547
#define V_QUAD 471              // bike
#define V_RAINDANC 563          // air
#define V_RANCHER 489
#define V_RCBANDIT 441
#define V_RCBARON 464           // air
#define V_RCCAM 594
#define V_RCGOBLIN 501          // air
#define V_RCRAIDER 465          // air
#define V_RCTIGER 564
#define V_RDTRAIN 515
#define V_REEFER 453            // water
#define V_REGINA 479
#define V_REMINGTN 534
#define V_RHINO 432
#define V_RNCHLURE 505
#define V_ROMERO 442
#define V_RUMPO 440
#define V_RUSTLER 476           // air
#define V_SABRE 475
#define V_SADLER 543
#define V_SADLSHIT 605
#define V_SANCHEZ 468           // bike
#define V_SANDKING 495
#define V_SAVANNA 567
#define V_SEASPAR 447           // air
#define V_SECURICA 428
#define V_SENTINEL 405
#define V_SHAMAL 519            // air
#define V_SKIMMER 460           // air
#define V_SLAMVAN 535
#define V_SOLAIR 458
#define V_SPARROW 469           // air
#define V_SPEEDER 452           // water
#define V_SQUALO 446            // water
#define V_STAFFORD 580
#define V_STALLION 439
#define V_STRATUM 561
#define V_STREAK 538
#define V_STREAKC 570
#define V_STRETCH 409
#define V_STUNT 513             // air
#define V_SULTAN 560
#define V_SUNRISE 550
#define V_SUPERGT 506
#define V_SWATVAN 601
#define V_SWEEPER 574
#define V_TAHOMA 566
#define V_TAMPA 549
#define V_TAXI 420
#define V_TOPFUN 459
#define V_TORNADO 576
#define V_TOWTRUCK 525
#define V_TRACTOR 531
#define V_TRAM 449
#define V_TRASH 408
#define V_TROPIC 454
#define V_TUG 583
#define V_TUGSTAIR 608
#define V_TURISMO 451
#define V_URANUS 558
#define V_UTILITY 552
#define V_UTILTR1 611
#define V_VCNMAV 488            // air
#define V_VINCENT 540
#define V_VIRGO 491
#define V_VOODOO 412
#define V_VORTEX 539            // hovercraft
#define V_WALTON 478
#define V_WASHING 421
#define V_WAYFARER 586          // bike
#define V_WILLARD 529
#define V_WINDSOR 555
#define V_YANKEE 456
#define V_YOSEMITE 554
#define V_ZR350 477


enum VehicleInfo {
	vehicle_model,
    	vehicle_name[MAX_NAME],
    	vehicle_nameid[MAX_NAME],
    	vehicle_speed,
    	vehicle_level,
    	vehicle_cost
}
#define VEHICLES_SIZE 212
#define VEHICLES_START 400
new VehiclesInfo[VEHICLES_SIZE][VehicleInfo] = {
{509,	"Bike",			"bike",			120,	1, 0},
{510,	"MountainBike",		"mtbike",		140,	1, 0},
{492,	"Greenwood",		"greenwoo",		160,	1, 19000},
{410,	"Manana",		"manana",		160,	1, 9000},
{481,	"BMX",			"bmx",			120,	1, 0},
{482,	"Burrito",		"burrito",		150,	1, 26000},
{439,	"Stallion",		"stallion",		160,	1, 19000},
{413,	"Pony",			"pony",			160,	1, 20000},
{419,	"Esperanto",		"esperant",		160,	1, 19000},
{475,	"Sabre",		"sabre",		160,	2, 19000},
{505,	"Rancher",		"rnchlure",		170,	2, 40000},
{420,	"Taxi",			"taxi",			180,	2, 0},
{412,	"Voodoo",		"voodoo",		160,	2, 30000},
{468,	"Sanchez",		"sanchez",		190,	4, 10000},
{489,	"Rancher",		"rancher",		170,	4, 40000},
{405,	"Sentinel",		"sentinel",		165,	5, 35000},
{400,	"Landstalker",		"landstal",		160,	5, 25000},
{440,	"Rumpo",		"rumpo",		160,	5, 26000},
{436,	"Previon",		"previon",		160,	6, 9000},
{496,	"Blista Compact",	"blistac",		200,	6, 35000},
{422,	"Bobcat",		"bobcat",		165,	6, 26000},
{416,	"Ambulance",		"ambulan",		155,	7, 0},
{461,	"PCJ-600",		"pcj600",		190,	7, 10000},
{477,	"ZR350",		"zr350",		200,	7, 45000},
{500,	"Mesa",			"mesa",			160,	8, 25000},
{424,	"BF Injection",		"bfinject",		170,	8, 15000},
{402,	"Buffalo",		"buffalo",		200,	9, 35000},
{411,	"Infernus",		"infernus",		240,	9, 95000},
{504,	"Bloodring Banger",	"bloodra",		160,	10, 500},
{478,	"Walton",		"walton",		150,	10, 26000},
{535,	"Slamvan",		"slamvan",		160,	11, 19000},
{463,	"Freeway",		"freeway",		190,	11, 10000},
{494,	"Hotring",		"hotring",		220,	11, 0},
{506,	"SuperGT",		"supergt",		230,	12, 105000},
{429,	"Banshee",		"banshee",		200,	12, 45000},
{451,	"Turismo",		"turismo",		240,	13, 95000},
{495,	"Sandking",		"sandking",		170,	13, 40000},
{415,	"Cheetah",		"cheetah",		230,	17, 105000},
{470,	"Patriot",		"patriot",		170,	19, 40000},
{401,	"Bravura",		"bravura",		160,	0, 9000},
{403,	"Linerunner",		"linerun",		120,	0, 35000},
{404,	"Perennial",		"peren",		150,	0, 10000},
{406,	"Dumper",		"dumper",		110,	0, 0},
{407,	"Firetruck",		"firetruk",		170,	0, 0},
{408,	"Trashmaster",		"trash",		110,	0, 0},
{409,	"Stretch",		"stretch",		180,	0, 40000},
{414,	"Mule",			"mule",			140,	0, 22000},
{417,	"Leviathan",		"leviathn",		200,	0, 0},
{418,	"Moonbeam",		"moonbeam",		150,	0, 16000},
{421,	"Washington",		"washing",		180,	0, 18000},
{423,	"Mr Whoopee",		"mrwhoop",		145,	0, 29000},
{425,	"Hunter",		"hunter",		200,	0, 0},
{426,	"Premier",		"premier",		200,	0, 25000},
{427,	"Enforcer",		"enforcer",		170,	0, 0},
{428,	"Securicar",		"securica",		170,	0, 0},
{430,	"Predator",		"predator",		190,	0, 0},
{431,	"Bus",			"bus",			130,	0, 0},
{432,	"Rhino",		"rhino",		80,	0, 0},
{433,	"Barracks",		"barracks",		180,	0, 0},
{434,	"Hotknife",		"hotknife",		200,	0, 35000},
{435,	"Trailer",		"artict1",		120,	0, 0},
{437,	"Coach",		"coach",		160,	0, 0},
{438,	"Cabbie",		"cabbie",		160,	0, 0},
{441,	"RCBandit",		"rcbandit",		75,	0, 0},
{442,	"Romero",		"romero",		150,	0, 10000},
{443,	"Packer",		"packer",		150,	0, 20000},
{444,	"Monster",		"monster",		110,	0, 40000},
{445,	"Admiral",		"admiral",		165,	0, 35000},
{446,	"Squalo",		"squalo",		280,	0, 0},
{447,	"Seasparrow",		"seaspar",		200,	0, 0},
{448,	"Pizzaboy",		"pizzaboy",		190,	0, 10000},
{449,	"Tram",			"tram",			150,	0, 0},
{450,	"Trailer",		"artict2",		120,	0, 0},
{452,	"Speeder",		"speeder",		190,	0, 0},
{453,	"Reefer",		"reefer",		190,	0, 0},
{454,	"Tropic",		"tropic",		190,	0, 0},
{455,	"Flatbed",		"flatbed",		140,	0, 10000},
{456,	"Yankee",		"yankee",		160,	0, 22000},
{457,	"Caddy",		"caddy",		160,	0, 0},
{458,	"Solair",		"solair",		165,	0, 18000},
{459,	"Berkley'sRCVan",	"topfun",		160,	0, 20000},
{460,	"Skimmer",		"skimmer",		200,	0, 0},
{462,	"Faggio",		"faggio",		190,	0, 10000},
{464,	"RCBaron",		"rcbaron",		75,	0, 0},
{465,	"RCRaider",		"rcraider",		75,	0, 0},
{466,	"Glendale",		"glendale",		160,	0, 20000},
{467,	"Oceanic",		"oceanic",		160,	0, 20000},
{469,	"Sparrow",		"sparrow",		200,	0, 0},
{471,	"Quad",			"quad",			160,	0, 9000},
{472,	"Coastguard",		"coastg",		190,	0, 0},
{473,	"Dinghy",		"dinghy",		190,	0, 0},
{474,	"Hermes",		"hermes",		160,	0, 19000},
{476,	"Rustler",		"rustler",		200,	0, 0},
{479,	"Regina",		"regina",		165,	0, 18000},
{480,	"Comet",		"comet",		200,	0, 35000},
{483,	"Camper",		"camper",		120,	0, 26000},
{484,	"Marquis",		"marquis",		190,	0, 0},
{485,	"Baggage",		"baggage",		160,	0, 0},
{486,	"Dozer",		"dozer",		100,	0, 0},
{487,	"Maverick",		"maverick",		200,	0, 0},
{488,	"NewsChopper",		"vcnmav",		200,	0, 0},
{490,	"FBIRancher",		"fbiranch",		170,	0, 0},
{491,	"Virgo",		"virgo",		160,	0, 9000},
{493,	"Jetmax",		"jetmax",		190,	0, 0},
{497,	"PoliceMaverick",	"polmav",		200,	0, 0},
{498,	"Boxville",		"boxville",		140,	0, 22000},
{499,	"Benson",		"benson",		140,	0, 22000},
{501,	"RCGoblin",		"rcgoblin",		75,	0, 0},
{502,	"HotringRacer",		"hotrina",		220,	0, 0},
{503,	"HotringRacer",		"hotrinb",		220,	0, 0},
{507,	"Elegant",		"elegant",		165,	0, 35000},
{508,	"Journey",		"journey",		140,	0, 22000},
{511,	"Beagle",		"beagle",		200,	0, 0},
{512,	"Cropdust",		"cropdust",		200,	0, 0},
{513,	"Stunt",		"stunt",		200,	0, 0},
{514,	"Trailer",		"petro",		120,	0, 0},
{515,	"RoadTrain",		"rdtrain",		120,	0, 35000},
{516,	"Nebula",		"nebula",		165,	0, 35000},
{517,	"Majestic",		"majestic",		165,	0, 35000},
{518,	"Buccaneer",		"buccanee",		160,	0, 19000},
{519,	"Shamal",		"shamal",		330,	0, 0},
{520,	"Hydra",		"hydra",		330,	0, 0},
{521,	"FCR-900",		"fcr900",		190,	0, 10000},
{522,	"NRG-500",		"nrg500",		190,	0, 10000},
{523,	"HPV1000",		"copbike",		190,	0, 0},
{524,	"CementTruck",		"cement",		110,	0, 0},
{525,	"TowTruck",		"towtruck",		160,	0, 0},
{526,	"Fortune",		"fortune",		160,	0, 19000},
{527,	"Cadrona",		"cadrona",		160,	0, 9000},
{528,	"FBITruck",		"fbitruck",		170,	0, 0},
{529,	"Willard",		"willard",		160,	0, 19000},
{530,	"Forklift",		"forklift",		60,	0, 0},
{531,	"Tractor",		"tractor",		70,	0, 0},
{532,	"Combine",		"combine",		140,	0, 0},
{533,	"Feltzer",		"feltzer",		200,	0, 35000},
{534,	"Remington",		"remingtn",		160,	0, 30000},
{536,	"Blade",		"blade",		160,	0, 19000},
{537,	"Freight",		"freight",		110,	0, 0},
{538,	"Streak",		"streak",		110,	0, 0},
{539,	"Vortex",		"vortex",		150,	0, 26000},
{540,	"Vincent",		"vincent",		160,	0, 19000},
{541,	"Bullet",		"bullet",		230,	0, 105000},
{542,	"Clover",		"clover",		160,	0, 19000},
{543,	"Sadler",		"sadler",		165,	0, 26000},
{544,	"Firetruck",		"firela",		170,	0, 0},
{545,	"Hustler",		"hustler",		160,	0, 20000},
{546,	"Intruder",		"intruder",		160,	0, 19000},
{547,	"Primo",		"primo",		160,	0, 19000},
{548,	"Cargobob",		"cargobob",		200,	0, 0},
{549,	"Tampa",		"tampa",		160,	0, 19000},
{550,	"Sunrise",		"sunrise",		160,	0, 19000},
{551,	"Merit",		"merit",		165,	0, 35000},
{552,	"Utility",		"utility",		160,	0, 0},
{553,	"Nevada",		"nevada",		200,	0, 0},
{554,	"Yosemite",		"yosemite",		170,	0, 40000},
{555,	"Windsor",		"windsor",		180,	0, 35000},
{556,	"Monster",		"monstera",		110,	0, 0},
{557,	"Monster",		"monsterb",		110,	0, 0},
{558,	"Uranus",		"uranus",		200,	0, 35000},
{559,	"Jester",		"jester",		200,	0, 35000},
{560,	"Sultan",		"sultan",		200,	0, 35000},
{561,	"Stratum",		"stratum",		200,	0, 35000},
{562,	"Elegy",		"elegy",		200,	0, 35000},
{563,	"Raindance",		"raindanc",		200,	0, 0},
{564,	"RCTiger",		"rctiger",		75,	0, 0},
{565,	"Flash",		"flash",		200,	0, 35000},
{566,	"Tahoma",		"tahoma",		160,	0, 35000},
{567,	"Savanna",		"savanna",		160,	0, 19000},
{568,	"Bandito",		"bandito",		170,	0, 15000},
{569,	"Freight",		"freiflat",		110,	0, 0},
{570,	"Trailer",		"streakc",		110,	0, 0},
{571,	"Kart",			"kart",			90,	0, 15000},
{572,	"Mower",		"mower",		60,	0, 15000},
{573,	"Duneride",		"duneride",		110,	0, 40000},
{574,	"Sweeper",		"sweeper",		60,	0, 0},
{575,	"Broadway",		"broadway",		160,	0, 19000},
{576,	"Tornado",		"tornado",		160,	0, 19000},
{577,	"AT-400",		"at400",		200,	0, 0},
{578,	"DFT-30",		"dft30",		110,	0, 5000},
{579,	"Huntley",		"huntley",		160,	0, 40000},
{580,	"Stafford",		"stafford",		165,	0, 35000},
{581,	"BF-400",		"bf400",		190,	0, 10000},
{582,	"Newsvan",		"newsvan",		160,	0, 0},
{583,	"Tug",			"tug",			170,	0, 0},
{584,	"Trailer",		"petrotr",		120,	0, 0},
{585,	"Emperor",		"emperor",		165,	0, 35000},
{586,	"Wayfarer",		"wayfarer",		190,	0, 10000},
{587,	"Euros",		"euros",		200,	0, 35000},
{588,	"HotDog Van",		"hotdog",		140,	0, 22000},
{589,	"Club",			"club",			200,	0, 35000},
{590,	"Trailer",		"freibox",		110,	0, 0},
{591,	"Trailer",		"artict3",		120,	0, 0},
{592,	"Andromada",		"androm",		200,	0, 0},
{593,	"Dodo",			"dodo",			200,	0, 0},
{594,	"RCCam",		"rccam",		60,	0, 0},
{595,	"Launch",		"launch",		190,	0, 0},
{596,	"PoliceCar(LSPD)",	"copcarla",		200,	0, 0},
{597,	"PoliceCar(SFPD)",	"copcarsf",		200,	0, 0},
{598,	"PoliceCar(LVPD)",	"copcarvg",		200,	0, 0},
{599,	"PoliceRanger",		"copcarru",		160,	0, 0},
{600,	"Picador",		"picador",		165,	0, 26000},
{601,	"S.W.A.T.Van",		"swatvan",		110,	0, 0},
{602,	"Alpha",		"alpha",		200,	0, 35000},
{603,	"Phoenix",		"phoenix",		200,	0, 35000},
{604,	"Glendale",		"glenshit",		160,	0, 20000},
{605,	"Sadler",		"sadlshit",		165,	0, 0},
{606,	"LuggageTrailer",	"bagboxa",		160,	0, 0},
{607,	"LuggageTrailer",	"bagboxb",		160,	0, 0},
{608,	"StairTrailer",		"tugstair",		160,	0, 0},
{609,	"Boxbville",		"boxburg",		140,	0, 0},
{610,	"FarmPlow",		"farmtr1",		160,	0, 0},
{611,	"UtilityTrailer",	"utiltr1",		160,	0, 0}
};

#if SAVE_VEHICLES_IN_DB

enum vInfo
{
	modeldb,
	Float:x_spawn,
	Float:y_spawn,
	Float:z_spawn,
 	Float:za_spawn,
 	color_1,
 	color_2,
	mod1,
	mod2,
	mod3,
	mod4,
	mod5,
	mod6,
	mod7,
	mod8,
	mod9,
	mod10,
	mod11,
	mod12,
	mod13,
	mod14,
	mod15,
	mod16,
	mod17,
	paintjob,
	interiorid
};

new VehicleDBInfo[MAX_DEFAULT_VEHICLE_SPAWNS][vInfo];

#else 

enum VehicleSpawnInfo {
	vspawn_model, 			 // Model
	Float:vspawn_x,         // X
	Float:vspawn_y,         // Y
	Float:vspawn_z,         // Z
	Float:vspawn_heading,   // Heading
    	vspawn_colour1,         // Colour1
    	vspawn_colour2,         // Colour2
	vspawn_interior		// interior
}

new VehiclesNotFileSpawns[][VehicleSpawnInfo] = {
{402,1586.427734,33.143398,23.000000,274.233093,-1,-1,0},
{463,1587.815185,25.931900,22.700000,270.257690,-1,-1,0},
{475,1514.199951,11.289690,23.867700,283.604309,-1,-1,0},
{429,1544.431152,14.639800,23.862600,283.202789,-1,-1,0},
{554,1423.404296,222.655807,19.283500,334.931213,-1,-1,0},
{444,1446.484252,369.704101,18.694299,72.692497,-1,-1,0},
{402,316.655487,-52.103500,1.578099,166.468399,-1,-1,0},
{444,2415.209716,121.211502,26.847799,268.124298,24,123,0},
{444,1932.247070,176.757797,37.427299,74.080200,-1,-1,0},
{444,2129.423339,-358.831787,68.122703,301.207000,-1,-1,0},
{444,2218.000732,-1166.078735,26.097900,269.760498,-1,-1,0},
{468,322.348602,871.526794,20.770599,126.771598,-1,-1,0},
{444,471.056793,957.535217,5.139698,271.869384,-1,-1,0},
{471,2155.290283,-95.783203,3.104300,35.513099,-1,-1,0},
{452,2101.161132,-98.132102,-0.538299,110.421798,-1,-1,0},
{481,1938.284301,-1362.953613,17.429800,92.104103,-1,-1,0},
{468,1961.087524,-1389.569335,17.206800,177.944198,-1,-1,0},
{468,1952.911376,-1383.528686,18.359699,192.197296,-1,-1,0},
{468,1970.812866,-1446.178833,13.296998,94.713302,-1,-1,0},
{481,1889.363525,-1448.593872,13.269900,89.495697,-1,-1,0},
{476,1860.795898,-2623.451904,13.328700,3.990499,-1,-1,0},
{476,1718.218383,-2625.343261,13.328598,352.537414,-1,-1,0},
{553,1482.498901,-2620.614501,13.328700,266.718505,-1,-1,0},
{476,837.286315,-2045.153808,12.546792,2.295300,-1,-1,0},
{444,-81.967399,-1584.963256,2.290400,47.628299,-1,-1,0},
{453,2293.421875,517.551391,1.753700,270.788909,1,3,0},
{454,-218.462371,-1728.921020,1.584892,0.000000,1,3,0},
{430,1624.590087,565.856811,1.781700,200.529205,1,3,0},
{493,328.223144,-1911.753906,1.531687,0.000000,1,3,0},
{493,772.429321,2912.557861,1.075299,69.670600,1,3,0},
{493,-94.688499,455.401794,1.571900,250.547302,1,3,0},
{595,733.004821,-1508.589965,1.673374,0.000000,1,3,0},
{484,-429.330993,1163.593505,1.576516,0.000000,1,3,0},
{493,-928.969421,2682.082519,40.096523,260.573211,1,3,0},
{484,-816.395080,2222.737548,43.004501,268.186096,1,3,0},
{493,-2240.853759,2434.016357,1.301584,0.000000,1,3,0},
{484,-2204.891357,2427.672119,1.644711,0.000000,1,3,0},
{595,-1413.357421,285.362091,1.539489,90.000000,1,3,0},
{493,-1649.985229,253.474777,1.591547,90.000000,1,3,0},
{559,-1662.313842,443.360931,6.814215,270.693511,-1,-1,0},
{420,2100.694091,-1782.087036,13.052886,100.000000,-1,-1,0},
{420,333.937713,-1808.899047,4.065021,100.000000,-1,-1,0},
{438,2856.975097,-1851.990966,10.779706,100.000000,-1,-1,0},
{409,2133.127929,2355.674560,10.471879,90.000000,-1,-1,0},
{409,2215.352050,1325.103027,10.449990,100.000000,-1,-1,0},
{409,-376.536865,1154.309082,19.742187,0.000000,-1,-1,0},
{512,1421.892211,-2491.602294,13.385993,271.936309,13,13,0},
{519,1476.885375,1791.075073,10.565999,173.677795,101,1,0},
{553,-1646.973999,-153.306701,15.121294,317.388885,43,0,0},
{487,1614.715332,1548.751342,11.274900,347.151611,58,8,0},
{487,1647.790161,1538.993408,11.243300,51.807098,0,8,0},
{513,1583.678100,1195.370971,10.812500,0.000000,1,1,0},
{563,-2227.513916,2326.450439,7.546875,0.000000,-1,-1,0},
{469,-1465.884643,1489.550048,8.269489,0.000000,0,8,0},
{469,1118.040039,-2052.400390,74.441894,0.000000,-1,-1,0},
{417,2434.139892,2785.981445,10.487292,180.000000,-1,-1,0},
{548,339.961669,2466.137207,16.511518,0.000000,-1,-1,0},
{447,-781.326232,2435.869140,157.214248,0.000000,-1,-1,0},
{487,1290.273071,-786.786865,97.172073,0.000000,-1,-1,0},
{599,1535.861816,-1668.105712,13.136651,0.000000,-1,-1,0},
{523,1535.655639,-1677.509521,13.136195,0.000000,-1,-1,0},
{597,1564.711425,-1710.237304,5.646468,0.000000,-1,-1,0},
{490,1538.605102,-1646.273437,5.645132,180.000000,-1,-1,0},
{528,1528.584960,-1683.566406,6.017978,90.000000,-1,-1,0},
{497,-1680.362182,705.798828,30.701562,0.000000,58,8,0},
{490,-1600.234375,676.249694,-5.585824,0.000000,-1,-1,0},
{427,-1639.449218,653.676330,-5.198266,-90.000000,-1,-1,0},
{597,-1622.233154,651.307128,6.843780,0.000000,-1,-1,0},
{523,-1634.547363,651.403076,7.229948,0.000000,-1,-1,0},
{598,2277.684570,2477.109619,10.565196,180.108993,0,1,0},
{598,2256.289062,2458.510986,10.567996,358.733489,0,1,0},
{523,2294.730468,2441.265136,10.385993,9.376399,0,0,0},
{523,2290.726806,2441.332275,10.394392,16.459400,0,0,0},
{411,-2119.775634,-2513.211181,31.194400,324.947814,43,0,0},
{567,-275.504913,-2183.662109,28.552099,209.447296,6,1,0},
{522,-2798.199707,-340.035186,6.964097,268.104187,6,1,0},
{506,-2776.554931,-282.396392,6.818994,0.294800,6,1,0},
{560,-2670.129394,-35.536098,4.116000,179.757507,6,1,0},
{506,-2695.833496,98.826202,4.115600,85.094703,6,1,0},
{576,-2758.669921,629.027221,27.691900,357.683685,6,1,0},
{468,-2619.651855,730.013916,28.430099,272.118286,6,1,0},
{415,-2575.216552,915.525512,64.761001,270.345092,6,1,0},
{587,-2354.604492,983.565307,50.476898,1.864899,6,1,0},
{562,-2111.596923,740.724182,69.342498,90.000000,6,1,0},
{539,-2431.136474,2316.403564,4.664079,0.000000,6,1,0},
{560,-2135.472167,-416.524902,34.993389,0.000000,-1,1,0},
{421,-1771.622924,740.365173,32.514999,270.752899,6,1,0},
{471,-1512.001586,747.332580,6.965600,29.954799,6,1,0},
{400,-1573.835205,1225.754516,6.966800,96.899200,6,1,0},
{549,-1995.182739,1331.611328,6.965000,134.627899,6,1,0},
{463,-2524.008789,1227.354003,37.204498,25.983999,6,1,0},
{439,-2279.534179,1093.416870,79.860198,193.990295,6,1,0},
{439,-2437.737548,2512.243896,13.628739,0.000000,-1,-1,0},
{549,1665.782592,2780.436767,10.820302,90.000000,-1,-1,0},
{549,-2242.417724,529.756713,34.950599,178.240295,6,1,0},
{506,-2266.990722,148.802200,34.940101,87.760498,6,1,0},
{567,-2089.702148,-83.583602,34.949501,184.704895,6,1,0},
{411,-1534.902709,-418.922698,5.908998,43.221698,6,1,0},
{451,-1630.053222,-184.683502,14.130900,61.652500,6,1,0},
{400,-1897.870361,-774.088500,31.801799,266.975311,6,1,0},
{471,-1898.802001,-960.866516,31.801599,266.575408,6,1,0},
{511,-1341.107910,-254.378692,15.070096,321.633789,1,1,0},
{519,-1371.177490,-232.396697,15.067600,315.609100,1,1,0},
{519,1642.984985,-2425.206298,14.474390,159.874496,1,1,0},
{403,2440.162109,-1135.776245,34.527168,0.000000,-1,-1,0},
{403,-2041.904052,-2388.856201,30.257677,90.000000,-1,-1,0},
{584,-2014.336669,-2409.701416,30.282669,180.000000,-1,-1,0},
{515,-84.457801,-1190.583129,1.429700,74.682197,-1,-1,0},
{514,-76.514503,-1111.369628,0.757799,157.207901,-1,-1,0},
{406,636.410705,889.855590,-41.944900,149.199096,-1,-1,0},
{406,528.793701,847.698181,-43.387699,0.000000,-1,-1,0},
{451,2040.052001,1319.279907,10.377900,183.243896,16,16,0},
{429,2040.524658,1359.278320,10.351593,177.130599,13,13,0},
{421,2110.410156,1398.367187,10.755200,359.596405,13,13,0},
{411,2074.962402,1479.212036,10.399000,359.686096,64,64,0},
{477,2075.603759,1666.974975,10.425200,359.750701,94,94,0},
{541,2119.584472,1938.596923,10.296690,181.906402,22,22,0},
{541,1843.788085,1216.012207,10.455595,270.879302,60,1,0},
{402,1944.100341,1344.771728,8.941100,0.816797,30,30,0},
{402,-2231.238769,305.601837,34.774967,0.000000,90,90,0},
{415,1685.487182,1751.966674,10.598999,0.000000,25,1,0},
{411,2034.501586,1912.587402,11.904800,0.290899,123,1,0},
{470,270.508148,1966.757080,17.660625,251.327804,43,0,0},
{470,272.634033,1978.573120,17.660625,310.908111,43,0,0},
{562,2038.104370,1006.402221,10.404000,179.264099,11,1,0},
{559,2038.161376,1014.856628,10.404000,179.866500,11,1,0},
{560,2142.064208,1019.268798,10.479928,90.000000,11,1,0},
{560,2558.870605,2059.468505,10.572422,0.000000,11,1,0},
{411,2172.168212,1988.864257,10.547400,89.915100,116,1,0},
{429,2245.575927,2042.416625,10.500000,270.734985,14,14,0},
{477,2361.153808,1993.976074,10.425992,178.392898,101,1,0},
{552,2221.994628,1998.778686,9.681500,92.618797,53,53,0},
{558,-2794.197509,237.408340,7.187500,0.000000,116,1,0},
{587,2276.708496,1938.726318,31.504600,359.232086,40,1,0},
{587,2602.776855,1853.066650,10.546792,91.481300,43,1,0},
{603,2610.760009,1694.258789,10.658493,89.330299,69,1,0},
{587,2635.241943,1075.772583,10.547200,89.957099,53,1,0},
{562,2577.235351,1038.806274,10.477700,181.706893,35,1,0},
{562,1881.051025,957.211975,10.478899,270.438812,11,1,0},
{506,2039.125732,1545.087890,10.348093,359.669006,123,1,0},
{429,2010.084106,2489.551025,10.500300,268.772003,1,2,0},
{415,2076.403320,2468.794677,10.592300,359.918609,36,1,0},
{487,2093.275390,2414.942138,74.755599,89.024696,26,57,0},
{506,2352.902587,2577.976806,10.520092,0.409099,7,7,0},
{506,2166.696289,2741.041259,10.524497,89.781600,52,52,0},
{468,2142.460693,2799.496582,10.390315,90.000000,-1,-1,0},
{444,-91.542282,-89.598037,3.117187,0.000000,-1,-1,0},
{522,-66.665290,144.868133,3.117187,0.000000,-1,-1,0},
{444,1127.064941,2840.785644,11.354654,180.000000,112,1,0},
{411,1960.998901,2754.907226,10.547300,200.431594,112,1,0},
{429,-1507.234985,1966.654174,48.421875,0.000000,2,1,0},
{415,1673.803833,2693.804443,10.591197,359.790313,40,1,0},
{402,-2847.672851,-878.060668,9.154472,0.000000,30,30,0},
{603,1580.453735,2838.288574,10.661396,181.457305,75,77,0},
{552,1555.273437,2750.526123,10.638792,91.777297,62,62,0},
{481,1455.930541,2878.528808,10.583700,181.098693,118,1,0},
{477,1537.842529,2578.052490,10.566200,0.064998,121,1,0},
{451,1433.159423,2607.376220,10.378100,88.001296,16,16,0},
{603,2223.589843,1288.146362,10.510396,182.029693,18,1,0},
{558,2451.670654,1207.117919,10.451000,179.895996,24,1,0},
{552,2461.725341,1357.970458,10.638895,180.292694,62,62,0},
{558,2461.816162,1629.226806,10.449600,181.462493,117,1,0},
{477,2395.755371,1658.959106,10.574000,359.737396,0,1,0},
{477,1553.369628,1020.288391,10.553194,270.682495,119,50,0},
{400,1380.830444,1159.178222,10.912796,355.711700,123,1,0},
{402,1383.463012,1035.041992,10.913100,91.251502,117,227,0},
{400,-2621.397216,1375.465209,6.775382,0.000000,113,1,0},
{477,1658.546264,1028.543212,10.553297,359.841888,101,101,0},
{439,1064.233154,1215.415771,10.415699,177.294204,72,1,0},
{477,1111.453613,1788.389282,10.415800,92.462699,72,1,0},
{522,953.281799,1806.139160,8.218791,235.070602,3,8,0},
{522,995.532775,1886.605468,10.535900,90.104797,3,8,0},
{463,993.708312,2267.413330,11.031497,1.560999,75,13,0},
{400,1439.566162,1999.982177,10.584300,0.419400,66,1,0},
{522,-2732.746337,2374.928466,72.084022,0.000000,6,25,0},
{522,2156.354003,2188.657226,10.241394,22.650400,6,25,0},
{522,2476.790039,2532.222167,21.441600,0.508099,8,82,0},
{522,2814.433105,2364.664062,10.390700,89.675201,36,105,0},
{400,-2226.167480,-226.242919,35.051227,0.000000,97,1,0},
{506,1670.108886,1297.832153,10.386400,359.493591,87,118,0},
{415,-1978.408691,445.592926,27.117801,0.000000,58,8,0},
{476,1283.000610,1324.884887,9.533200,275.046813,7,6,0},
{476,1283.510742,1361.317138,9.538200,271.168395,1,6,0},
{415,1319.103759,1279.179077,10.593091,0.966099,62,1,0},
{400,1710.576293,1805.927490,10.391098,176.502807,92,3,0},
{411,2822.362792,2240.359375,10.581192,89.753997,123,1,0},
{506,2876.801269,2326.841796,10.391400,267.894592,115,118,0},
{429,2842.055419,2637.010498,10.500000,182.294906,1,3,0},
{549,-2400.332031,-608.243652,132.648437,0.000000,72,39,0},
{549,-2510.048095,1224.527587,37.086101,0.000000,75,39,0},
{475,1914.232177,2148.259033,10.390600,267.729705,36,0,0},
{549,1904.752685,2157.431152,10.517498,183.772796,83,36,0},
{475,1534.320434,2202.896972,10.364398,4.910799,118,118,0},
{549,1613.155273,2200.266357,10.517600,89.620399,89,35,0},
{400,1552.129150,2341.785400,10.912590,274.081512,101,1,0},
{468,1637.628540,2329.877441,10.553791,89.640800,101,101,0},
{400,1357.416503,2259.715820,10.912590,269.556701,62,1,0},
{477,1281.745849,2571.671875,10.547200,270.612792,106,1,0},
{522,1305.529541,2528.307617,10.395500,88.724899,3,8,0},
{411,993.901977,2159.419433,10.390500,88.880500,74,74,0},
{415,1512.713378,787.693115,10.592100,359.579589,75,1,0},
{522,2299.587158,1469.791015,10.381500,258.498413,3,8,0},
{522,2133.642822,1012.853698,10.378890,87.128997,3,8,0},
{415,2266.733642,648.475585,11.005290,177.851699,0,1,0},
{463,2404.663574,647.925476,10.791893,183.768798,53,1,0},
{506,2628.104736,746.870422,10.524600,352.757385,3,3,0},
{549,2817.644531,928.346923,10.446990,359.523498,72,39,0},
{477,1919.882934,947.188598,10.471500,359.445312,11,1,0},
{562,1881.634643,1006.765319,10.478300,86.996696,11,1,0},
{429,9.106492,1165.506591,19.585500,2.128098,101,25,0},
{439,-504.896514,-98.296997,62.718135,0.000000,11,11,0},
{475,-1002.657958,1249.384887,33.263801,0.000000,22,22,0},
{402,69.463302,1217.018920,18.330400,158.934494,10,1,0},
{463,-199.418502,1223.040527,19.262399,176.700103,25,1,0},
{476,325.412109,2538.599853,17.518400,181.296401,71,77,0},
{476,291.097503,2540.041015,17.527599,182.720596,7,6,0},
{576,384.236511,2602.176269,16.092599,192.485794,72,1,0},
{439,423.801208,2541.687011,15.970800,338.242614,10,1,0},
{420,-1091.575805,-1654.377929,76.373939,0.000000,10,1,0},
{402,596.806396,866.257812,-43.261699,186.835906,67,8,0},
{463,835.083801,836.836975,11.873900,14.892000,8,90,0},
{549,843.189270,838.809326,12.517700,18.234800,79,39,0},
{400,-235.976699,1045.862304,19.815799,180.080596,75,1,0},
{599,-211.593994,998.985717,19.843700,265.493499,0,1,0},
{468,-304.062011,1024.111083,19.571399,94.181198,96,25,0},
{451,-290.314514,1567.153442,75.065399,133.169403,61,61,0},
{400,-441.343811,2215.702636,42.248901,191.795303,41,29,0},
{468,-2686.578369,885.874084,79.359535,0.000000,41,29,0},
{400,-1727.986328,-153.794509,3.212342,0.000000,41,29,0},
{468,-660.738525,2315.264160,138.386596,358.764312,6,6,0},
{439,-2261.783935,2288.625976,4.820209,0.000000,13,76,0},
{429,114.741600,1048.351684,13.288990,174.975204,1,2,0},
{411,-290.006500,1759.495849,42.415401,89.757102,116,1,0},
{522,-302.564910,1777.734863,42.251399,238.503906,6,25,0},
{402,-1039.526733,-1195.008789,129.222198,0.000000,75,1,0},
{411,-866.177429,1557.270019,23.831899,269.326293,31,1,0},
{552,-799.306213,1518.155639,26.748800,88.529502,53,53,0},
{468,-749.973022,1589.843505,26.531099,125.650802,92,3,0},
{554,-904.297790,1553.826904,25.922899,266.698486,34,30,0},
{429,-237.715698,2594.880371,62.382801,178.680206,1,2,0},
{402,2509.814941,2354.570800,10.403182,-90.000000,3,3,0},
{444,-1771.779907,1204.295166,24.829723,-90.000000,-1,-1,0},
{451,-2346.410156,1114.532470,55.180374,183.000000,-1,-1,0},
{415,-680.988220,955.449523,11.903200,84.275398,36,1,0},
{560,-2552.542480,626.121276,27.470169,0.000000,9,39,0},
{560,2142.402343,1408.567504,10.525794,0.365999,17,1,0},
{560,2196.333984,1856.846923,10.525691,179.807006,21,1,0},
{560,2103.414550,2069.151367,10.524900,270.145111,33,0,0},
{560,2361.804199,2210.995117,10.384799,178.736602,37,0,0},
{560,-1993.246459,241.532897,34.877399,310.011688,41,29,0},
{559,-1989.323486,270.144714,34.832099,88.682197,58,8,0},
{559,-1946.241577,273.248199,35.130199,126.419998,60,1,0},
{558,-774.045715,-2137.752685,25.876852,0.000000,24,1,0},
{562,-1952.889404,258.860412,40.708198,51.717201,17,1,0},
{411,-1949.868896,266.575897,40.777599,216.488204,112,1,0},
{429,-444.062561,-2261.816650,46.999832,0.000000,2,1,0},
{559,-1657.666015,1213.619506,6.906198,282.695312,13,8,0},
{560,-1658.372192,1213.223632,13.380599,37.905200,52,39,0},
{558,-1660.899414,1210.758911,20.787500,317.609802,36,1,0},
{552,-1645.240112,1303.988281,6.848196,133.601303,7,7,0},
{411,113.861099,1068.618164,13.339500,177.132995,116,1,0},
{429,159.519897,1185.115966,14.732398,85.576896,1,2,0},
{411,612.467773,1694.412597,6.719200,302.553894,75,1,0},
{522,661.760925,1720.989379,6.564095,19.123100,6,25,0},
{522,-2724.348632,985.318359,54.090805,0.000000,8,82,0},
{567,711.420715,1947.520751,5.405600,179.380996,90,96,0},
{567,1031.843505,1920.372558,11.336894,89.497802,97,96,0},
{567,-1942.724121,1227.488525,31.243553,0.000000,102,114,0},
{567,1641.680175,1299.211303,10.686900,271.489105,97,96,0},
{567,2135.875732,1408.451171,10.686697,180.456207,90,96,0},
{567,-2344.607666,-127.372894,34.945106,0.000000,99,81,0},
{567,2461.738037,1345.538452,10.697500,0.931698,114,1,0},
{567,-2539.946533,2432.732910,18.702194,0.000000,88,64,0},
{560,2805.168457,1361.400390,10.454792,270.234008,17,1,0},
{506,2853.537841,1361.467651,10.514900,269.664794,7,7,0},
{567,2633.983154,2205.706054,10.686800,180.007598,93,64,0},
{567,2119.975097,2049.312744,10.542300,180.196304,93,64,0},
{567,-2111.433105,-2314.316650,30.258714,226.985198,93,64,0},
{567,2787.897460,-1876.258300,9.696599,0.580398,99,81,0},
{411,2771.299316,-1841.562011,9.487000,20.767799,116,1,0},
{400,0.527898,21.828350,3.369044,250.694381,-1,-1,0},
{468,2443.175292,-1643.498291,13.463500,179.808395,-1,-1,0},
{439,2285.498046,-1735.572143,13.278880,266.753723,-1,-1,0},
{477,2061.825195,-1694.326416,13.546895,268.367706,-1,-1,0},
{439,2095.434570,-1816.787597,13.382800,100.780403,-1,-1,0},
{477,2062.940917,-1783.526000,13.552597,170.932907,-1,-1,0},
{400,1974.503173,-1577.128051,13.600000,236.077392,-1,-1,0},
{481,1936.169555,-1590.227416,13.565500,0.250099,-1,-1,0},
{468,1664.210083,-1608.921386,13.546895,99.726501,-1,-1,0},
{468,1544.739257,-1490.156127,13.555000,92.369300,-1,-1,0},
{411,1530.864746,-1501.945068,13.554697,96.772697,-1,-1,0},
{481,1585.759643,-1417.367431,13.574500,274.240905,-1,-1,0},
{468,1566.437622,-1309.328491,17.177400,85.905601,-1,-1,0},
{400,1619.115478,-1515.438842,13.583000,273.346405,-1,-1,0},
{439,1968.796875,-1105.215942,25.499799,170.977798,-1,-1,0},
{481,2045.782958,-1104.793701,24.472700,306.341491,-1,-1,0},
{475,1978.298095,-1222.417602,20.023399,89.079803,-1,-1,0},
{506,1852.498535,-1175.359130,23.828100,89.095199,-1,-1,0},
{475,1856.671386,-1057.316528,23.933099,6.349596,-1,-1,0},
{468,1763.177734,-1035.368530,23.960899,87.830001,-1,-1,0},
{463,1695.665649,-1057.309448,23.906299,181.417495,-1,-1,0},
{400,1661.568969,-1020.158874,23.898399,15.168600,-1,-1,0},
{475,1551.917358,-1026.107788,23.906299,156.173599,-1,-1,0},
{411,1332.906738,-1081.632080,25.126699,109.496498,-1,-1,0},
{468,1396.232910,-954.474975,34.918098,265.112304,-1,-1,0},
{402,1321.119384,-871.687194,39.578098,86.429397,-1,-1,0},
{481,1329.883789,-836.351989,55.432399,261.691589,-1,-1,0},
{481,1317.590209,-806.108276,78.276100,307.481292,-1,-1,0},
{420,1252.231323,-807.817199,84.140602,338.897491,-1,-1,0},
{400,1243.357055,-786.073120,90.228103,359.723602,-1,-1,0},
{400,2818.145996,-1086.312011,31.108900,180.037902,-1,-1,0},
{411,1499.303222,-1286.625000,14.132300,84.444801,-1,-1,0},
{400,1362.621459,-1552.948120,13.226593,163.171493,-1,-1,0},
{481,1329.132202,-1434.546508,14.634490,178.109298,-1,-1,0},
{468,1167.579956,-1773.569702,13.250000,180.061798,-1,-1,0},
{451,973.709411,-1832.768798,12.290596,77.193901,-1,-1,0},
{477,931.724487,-1832.813720,12.270792,77.864700,-1,-1,0},
{400,816.437011,-1750.969116,13.228590,0.198400,-1,-1,0},
{439,529.315002,-1722.220336,12.232700,83.222297,-1,-1,0},
{439,440.856689,-1749.017333,8.537899,174.035400,-1,-1,0},
{477,473.076812,-1764.659057,5.207900,265.854095,-1,-1,0},
{420,297.417907,-1716.772583,6.737800,72.885398,-1,-1,0},
{420,181.700103,-1535.502929,12.556400,332.549713,-1,-1,0},
{402,310.223114,-1688.339233,6.651895,257.404998,-1,-1,0},
{439,383.300811,-2074.126953,7.515600,181.015106,-1,-1,0},
{411,479.538085,-1497.628540,20.123800,177.760101,-1,-1,0},
{451,784.121215,-1623.221191,13.066390,90.899002,-1,-1,0},
{411,782.121215,-1605.453979,13.062500,82.070503,-1,-1,0},
{481,822.706481,-1493.896240,13.257100,271.133514,-1,-1,0},
{468,951.680114,-1355.848632,13.023400,263.014007,-1,-1,0},
{463,1121.613403,-1414.075927,13.250000,86.209396,-1,-1,0},
{451,1037.171264,-1125.463378,23.578699,0.656799,-1,-1,0},
{506,936.532775,-1121.820434,23.688198,184.594406,-1,-1,0},
{411,925.069274,-1121.433593,23.696399,178.531906,-1,-1,0},
{439,1006.159118,-932.996215,41.859401,274.976806,-1,-1,0},
{420,1054.626464,-881.661987,42.873699,11.267700,-1,-1,0},
{400,877.114624,-942.245910,41.286300,94.180297,-1,-1,0},
{402,831.807495,-858.080017,69.604598,17.586099,-1,-1,0},
{477,920.864929,-789.023376,114.038803,73.090499,-1,-1,0},
{477,1060.005249,-1133.603759,23.610099,83.190498,-1,-1,0},
{420,1348.795166,-1439.194580,13.328800,172.804199,-1,-1,0},
{468,1369.294189,-1889.282836,13.297900,183.518600,-1,-1,0},
{477,1664.974243,-1891.620971,13.328700,181.391296,-1,-1,0},
{439,1840.492187,-1863.505615,13.167900,265.194610,-1,-1,0},
{400,1946.603393,-2108.588378,13.329998,84.138603,-1,-1,0},
{439,1660.764038,-2448.403564,13.336500,264.737396,-1,-1,0},
{439,1792.310302,-2408.327880,13.336500,352.983612,-1,-1,0},
{400,2240.793457,-2133.238525,13.328598,311.944305,-1,-1,0},
{468,2239.888183,-2018.347167,13.328700,64.664497,-1,-1,0},
{420,2236.902587,-1739.369018,13.329298,271.793395,-1,-1,0},
{477,2293.928955,-1744.473754,13.328700,270.385314,-1,-1,0},
{477,2378.559570,-1890.800292,13.167798,93.158401,-1,-1,0},
{468,2380.341064,-1926.880126,13.164690,0.713698,-1,-1,0},
{463,2647.593994,-1850.228515,10.789093,207.118499,-1,-1,0},
{463,-1592.081909,-2727.235107,48.539062,0.000000,-1,-1,0},
{477,2770.171142,-2031.339721,13.342000,94.597198,-1,-1,0},
{481,2935.405273,-2051.178466,3.329600,90.935600,-1,-1,0},
{475,2867.766845,-1747.993530,10.827095,358.212402,-1,-1,0},
{429,2815.735839,-1540.880249,10.703598,3.142498,-1,-1,0},
{506,2803.796142,-1542.120361,10.706192,182.655700,-1,-1,0},
{481,2922.924072,-1258.026000,10.647294,9.023900,-1,-1,0},
{439,2604.347656,-1144.969238,49.998699,93.666297,-1,-1,0},
{475,2358.817626,-1372.560302,23.799800,167.276702,-1,-1,0},
{420,2328.267089,-1525.169067,24.893800,5.507100,-1,-1,0},
{429,2305.332763,-1536.766235,25.253299,177.541000,-1,-1,0},
{420,1898.313110,-1267.050903,13.338800,268.413513,-1,-1,0},
{439,2038.813476,-1221.114379,22.515699,129.419494,-1,-1,0},
{400,2173.801269,-997.081787,62.751800,169.927993,-1,-1,0},
{481,2457.801269,-959.503112,79.866500,359.314086,-1,-1,0},
{402,1499.081665,-709.143371,95.120300,172.031692,-1,-1,0},
{475,1285.968139,-618.743713,104.072402,43.438800,-1,-1,0},
{506,192.807006,-1105.946289,64.351097,332.967803,-1,-1,0},
{402,359.307098,-854.722473,11.460300,337.146911,-1,-1,0},
{400,666.350585,-467.681488,16.707199,92.084503,-1,-1,0},
{481,665.861328,-460.702301,16.707300,92.162597,-1,-1,0},
{400,734.867675,-589.306884,17.028299,272.260589,-1,-1,0},
{402,827.195800,-511.989196,17.154300,180.799804,-1,-1,0},
{475,1029.722412,-308.032196,74.362602,180.726501,-1,-1,0},
{439,1060.303100,-304.332794,74.363502,175.463500,-1,-1,0},
{506,1096.433837,-346.745391,74.363601,5.082600,-1,-1,0},
{475,251.723403,-268.020812,1.951900,85.960098,-1,-1,0},
{439,314.943786,-195.656799,1.949398,0.724500,-1,-1,0},
{420,314.865386,-31.387599,1.949000,98.747497,-1,-1,0},
{475,219.170303,25.545000,2.949398,296.378997,-1,-1,0},
{429,753.350708,277.111297,27.772699,198.565505,-1,-1,0},
{463,953.106811,191.282592,35.874801,251.966003,-1,-1,0},
{402,621.363220,50.637401,1.421200,186.754898,-1,-1,0},
{439,755.300476,383.402587,23.543300,281.172485,-1,-1,0},
{477,750.536315,348.812713,20.777799,146.031997,-1,-1,0},
{400,1021.520324,504.963409,20.605699,336.824584,-1,-1,0},
{402,1231.299926,299.834899,19.959600,153.885192,-1,-1,0},
{481,-1189.949096,-1138.230590,129.218750,0.000000,-1,-1,0},
{420,1289.220581,145.200805,20.833599,172.902801,-1,-1,0},
{463,2356.907714,-1139.778076,27.911312,0.000000,-1,-1,0},
{506,1980.360351,2626.241943,10.820302,0.000000,-1,-1,0},
{468,1829.195678,2617.586914,10.820302,180.000000,-1,-1,0},
{402,1373.270751,271.988891,19.938299,157.212203,-1,-1,0},
{477,-1935.393798,585.370483,34.743949,0.000000,-1,-1,0},
{468,-1705.558105,389.280975,6.817683,0.000000,-1,-1,0},
{468,-2068.420410,-83.469001,34.793556,0.000000,-1,-1,0},
{402,-2334.171142,-1582.490966,483.596313,180.000000,-1,-1,0},
{477,-2641.499023,1375.769409,6.779901,0.000000,-1,-1,0},
{420,-2068.135986,13.385396,34.978034,0.000000,-1,-1,0},
{411,-2073.332031,-2552.942871,30.101694,0.000000,-1,-1,0},
{411,-2688.419433,268.922393,3.964961,0.000000,-1,-1,0},
{420,-1017.753723,-683.789123,32.007812,0.000000,-1,-1,0},
{429,-850.099914,2748.552978,45.839096,0.000000,-1,-1,0},
{429,2707.274414,-1271.183471,58.425025,0.000000,-1,-1,0},
{451,-23.182325,966.536193,19.587717,0.000000,-1,-1,0},
{477,13.848106,1514.734863,12.756023,0.000000,-1,-1,0},
{429,-615.982543,2711.865722,72.303291,0.000000,-1,-1,0},
{475,2080.641845,-633.754455,64.597694,0.000000,-1,-1,0},
{451,2036.568725,-2463.402099,13.203207,0.000000,-1,-1,0},
{477,-114.843551,867.604858,18.600900,0.000000,-1,-1,0},
{439,1582.407104,-2286.934814,-3.121464,0.000000,-1,-1,0},
{402,2182.169189,-2535.770019,13.203207,0.000000,-1,-1,0},
{411,-1349.191284,2047.086547,53.154140,0.000000,-1,-1,0},
{429,-2454.221191,157.129302,34.595684,0.000000,-1,-1,0},
{400,212.714492,1389.384521,10.585927,0.000000,-1,-1,0},
{481,-2614.440673,448.117462,14.265704,0.000000,-1,-1,0},
{400,-1508.924438,2660.501708,55.374965,0.000000,-1,-1,0},
{420,-1522.499023,2577.795654,55.829471,0.000000,-1,-1,0},
{468,2657.380615,-1417.831909,30.204063,0.000000,-1,-1,0},
{506,-1660.517456,2488.525878,87.048721,0.000000,-1,-1,0},
{463,2177.038574,-2305.245117,13.203186,0.000000,-1,-1,0},
{468,1941.316528,-2142.073486,13.213582,0.000000,-1,-1,0},
{468,-1705.427246,896.053833,24.546955,0.000000,-1,-1,0},
{475,-2400.385498,-2181.031982,32.946758,0.000000,-1,-1,0},
{475,-2175.871826,293.690155,34.774768,0.000000,-1,-1,0},
{506,-2596.091796,308.824005,4.095557,0.000000,-1,-1,0},
{451,-1693.237915,977.420898,17.242288,0.000000,-1,-1,0},
{468,1724.999145,-2288.478271,13.195919,0.000000,-1,-1,0},
{400,1349.827148,-1286.469604,13.382802,0.000000,-1,-1,0},
{468,-1772.922485,1087.192871,45.101581,0.000000,-1,-1,0},
{439,-2264.416015,445.546600,34.829456,0.000000,-1,-1,0},
{481,-1203.266601,1830.315063,41.718750,0.000000,-1,-1,0},
{481,2504.978271,-1305.483398,34.647018,0.000000,-1,-1,0},
{481,-2312.654541,-33.085094,34.951175,0.000000,-1,-1,0},
{468,-1507.493041,2527.057373,55.227851,0.000000,-1,-1,0},
{481,-2524.761230,308.777923,34.773513,0.000000,-1,-1,0},
{506,-1434.199707,2175.520263,50.008739,0.000000,-1,-1,0},
{475,2301.668212,-2395.331298,13.041644,0.000000,-1,-1,0},
{475,-1031.385864,1540.800903,34.606834,0.000000,-1,-1,0},
{400,2421.833984,-1108.667236,40.977745,0.000000,-1,-1,0},
{402,-444.902374,621.349243,16.400814,0.000000,-1,-1,0},
{429,-2050.782226,1108.381103,52.946708,0.000000,-1,-1,0},
{481,-540.450561,2583.795166,53.406147,0.000000,-1,-1,0},
{402,1937.205200,-541.376708,18.968635,0.000000,-1,-1,0},
{468,1653.864746,-2145.705322,13.211009,0.000000,-1,-1,0},
{481,-1453.996215,2652.256347,55.829002,0.000000,-1,-1,0},
{429,-2100.544921,-2238.150634,30.282487,0.000000,-1,-1,0},
{468,-2248.361572,689.478149,49.025035,0.000000,-1,-1,0},
{411,-1672.420654,-987.226135,70.562141,0.000000,-1,-1,0},
{429,-2584.455078,586.952514,14.110915,0.000000,-1,-1,0},
{468,-1506.925048,2525.740966,55.680152,0.000000,-1,-1,0},
{429,1407.791137,-2347.792724,13.195425,0.000000,-1,-1,0},
{463,-1820.715820,-160.033416,9.035736,0.000000,-1,-1,0},
{402,-2291.356445,2658.460937,55.481483,0.000000,-1,-1,0},
{481,-1338.766601,2665.891845,50.124515,0.000000,-1,-1,0},
{411,-1799.264160,755.347229,24.817712,0.000000,-1,-1,0},
{451,2511.159912,49.402099,26.855699,267.512512,-1,-1,0},
{468,-2447.150878,740.236083,34.644699,0.000000,-1,-1,0},
{439,-2067.252441,1413.302612,6.758687,0.000000,-1,-1,0},
{420,-1733.641723,190.339965,3.212131,0.000000,-1,-1,0},
{475,-2408.589843,536.614929,29.584415,0.000000,-1,-1,0},
{411,-1430.737426,-950.174316,201.027542,0.000000,-1,-1,0},
{411,-2045.156982,1108.153076,52.866855,180.000000,-1,-1,0},
{475,-2415.061767,977.221435,44.874309,180.000000,-1,-1,0},
{400,-2396.093261,895.818725,45.025302,180.000000,-1,-1,0},
{451,-2468.575927,741.232177,34.594589,180.000000,-1,-1,0},
{400,-2519.356201,307.189636,34.695575,180.000000,-1,-1,0},
{411,-2217.663085,-109.498687,34.899379,180.000000,-1,-1,0},
{400,-2272.041015,-121.251655,34.898410,180.000000,-1,-1,0},
{481,-2458.183593,-7.194067,27.516994,180.000000,-1,-1,0},
{468,-2448.614990,-84.787033,33.624122,180.000000,-1,-1,0},
{468,-2629.646240,-36.258346,3.915601,180.000000,-1,-1,0},
{402,-2615.953125,-189.960357,3.914052,180.000000,-1,-1,0},
{400,-2716.839355,-186.542694,3.913352,180.000000,-1,-1,0},
{420,-2802.058837,-153.487945,6.759521,180.000000,-1,-1,0},
{402,-2801.710937,5.573849,6.757421,180.000000,-1,-1,0},
{400,-2828.094238,441.923919,4.027801,180.000000,-1,-1,0},
{468,-2878.169189,747.213562,30.084104,180.000000,-1,-1,0},
{420,-2858.645507,874.369812,43.494087,180.000000,-1,-1,0},
{468,-2847.871093,946.159362,43.633762,180.000000,-1,-1,0},
{468,-2857.755126,1061.489746,31.655250,180.000000,-1,-1,0},
{402,-2839.553222,1303.459106,6.674633,180.000000,-1,-1,0},
{475,-2110.442382,1244.012207,18.550285,180.000000,-1,-1,0},
{439,-2013.048217,769.479309,45.023719,180.000000,-1,-1,0},
{506,-2013.951293,705.753967,45.029327,180.000000,-1,-1,0},
{451,-1956.536132,585.402526,34.693920,180.000000,-1,-1,0},
{429,-2045.128051,466.213531,34.751323,180.000000,-1,-1,0},
{468,-1838.564331,-15.363636,14.698224,180.000000,-1,-1,0},
{400,-1855.139038,120.544425,14.697340,180.000000,-1,-1,0},
{463,-1231.025390,440.817199,6.767940,180.000000,-1,-1,0},
{429,-1238.910034,440.536407,6.764851,180.000000,-1,-1,0},
{420,-1247.551391,440.208953,6.772343,180.000000,-1,-1,0},
{477,-1476.543090,461.424530,6.765058,180.000000,-1,-1,0},
{400,-1828.593261,-49.043056,14.690624,180.000000,-1,-1,0},
{420,-1884.573242,-168.537567,11.536520,180.000000,-1,-1,0},
{411,-2055.563964,-308.032196,35.090892,180.000000,-1,-1,0},
{506,-2206.217529,-307.777801,35.144634,180.000000,-1,-1,0},
{475,-2144.625488,-410.612121,34.919441,180.000000,-1,-1,0},
{463,-2202.051757,-520.739746,47.099201,180.000000,-1,-1,0},
{400,-2110.149414,-962.723754,31.745277,180.000000,-1,-1,0},
{477,-1826.462646,-1338.166992,32.254547,180.000000,-1,-1,0},
{468,-1848.583618,-1616.915893,21.400211,180.000000,-1,-1,0},
{439,-1862.980834,-1614.904907,21.358432,180.000000,-1,-1,0},
{400,-1445.328857,-1495.895996,101.337478,180.000000,-1,-1,0},
{420,-1466.272460,-1556.307495,101.336975,180.000000,-1,-1,0},
{420,-970.249450,-1418.515136,129.637496,180.000000,-1,-1,0},
{481,-860.739074,-1448.223754,109.026710,180.000000,-1,-1,0},
{477,-835.560546,-1248.781982,72.889015,180.000000,-1,-1,0},
{402,-556.171813,-1044.773925,23.631345,180.000000,-1,-1,0},
{477,-369.012237,-1043.321899,58.943126,180.000000,-1,-1,0},
{400,-373.863250,-1444.758666,25.305643,180.000000,-1,-1,0},
{402,-80.645309,-1552.635864,2.189321,180.000000,-1,-1,0},
{411,294.027648,-1541.284545,24.170984,180.000000,-1,-1,0},
{439,304.800689,-1488.846679,24.180746,180.000000,-1,-1,0},
{402,547.344116,-1474.963989,14.310166,180.000000,-1,-1,0},
{402,478.356109,-1510.721801,20.121768,180.000000,-1,-1,0},
{481,683.737609,-1546.471191,14.426520,180.000000,-1,-1,0},
{402,703.317687,-1434.218261,13.120613,180.000000,-1,-1,0},
{400,743.631835,-1349.411743,13.082077,180.000000,-1,-1,0},
{481,750.841491,-1350.775146,13.082590,180.000000,-1,-1,0},
{439,670.988464,-1261.814941,13.208271,180.000000,-1,-1,0},
{477,775.033142,-1125.706909,23.405164,180.000000,-1,-1,0},
{451,766.116699,-1033.193969,23.614738,180.000000,-1,-1,0},
{402,781.679809,-1015.130004,25.941570,180.000000,-1,-1,0},
{439,926.710632,-996.988830,37.788822,180.000000,-1,-1,0},
{468,953.599670,-932.852172,42.313018,180.000000,-1,-1,0},
{411,1027.795043,-891.815185,41.740222,180.000000,-1,-1,0},
{506,1221.429443,-876.768066,42.473529,180.000000,-1,-1,0},
{463,1212.927124,-876.828857,42.493003,180.000000,-1,-1,0},
{402,1229.466064,-1005.935241,32.182121,180.000000,-1,-1,0},
{451,1220.293212,-1070.097534,28.803884,180.000000,-1,-1,0},
{481,1202.973388,-1100.392089,24.885143,180.000000,-1,-1,0},
{411,1183.895141,-1216.660644,18.319242,180.000000,-1,-1,0},
{439,1093.335449,-1216.161621,17.388019,180.000000,-1,-1,0},
{429,1087.965576,-1248.545898,15.404644,180.000000,-1,-1,0},
{439,1010.977539,-1301.774658,12.962424,180.000000,-1,-1,0},
{468,992.918579,-1254.508056,14.610272,180.000000,-1,-1,0},
{475,1014.413269,-1367.819824,12.949213,180.000000,-1,-1,0},
{468,1086.039916,-1381.870483,13.359045,180.000000,-1,-1,0},
{477,1147.433837,-1374.032836,13.355191,180.000000,-1,-1,0},
{400,1093.159179,-1315.289062,13.283143,180.000000,-1,-1,0},
{481,1107.176757,-1467.728149,15.376194,180.000000,-1,-1,0},
{468,1224.567749,-1534.403198,13.131401,180.000000,-1,-1,0},
{439,1273.709106,-1553.839721,13.138689,180.000000,-1,-1,0},
{439,1203.648925,-1628.177124,13.316926,180.000000,-1,-1,0},
{420,1184.052734,-1676.168579,13.126988,180.000000,-1,-1,0},
{420,1063.448852,-1739.908325,13.056447,180.000000,-1,-1,0},
{481,1081.711791,-1829.973876,13.203804,180.000000,-1,-1,0},
{477,1005.578613,-2233.725097,12.700037,180.000000,-1,-1,0},
{506,1398.113891,-2364.555664,13.132467,180.000000,-1,-1,0},
{439,1388.649536,-2314.168701,13.125119,180.000000,-1,-1,0},
{411,1385.353515,-2225.517822,13.124414,180.000000,-1,-1,0},
{451,1724.032592,-2092.572998,13.124336,180.000000,-1,-1,0},
{481,1704.261230,-2129.164062,13.133419,180.000000,-1,-1,0},
{411,1923.427978,-2119.758300,13.166810,180.000000,-1,-1,0},
{475,1975.233398,-2184.767822,13.126564,180.000000,-1,-1,0},
{429,2115.554931,-2144.043457,13.206954,180.000000,-1,-1,0},
{475,2090.651123,-2090.831298,13.118803,180.000000,-1,-1,0},
{468,2052.823486,-1905.237548,13.124258,180.000000,-1,-1,0},
{506,2248.644775,-1913.730712,13.126955,180.000000,-1,-1,0},
{420,2312.493896,-1993.241333,13.135046,180.000000,-1,-1,0},
{477,2473.395263,-1995.447509,13.126688,180.000000,-1,-1,0},
{429,2485.687744,-1953.026733,13.003602,180.000000,-1,-1,0},
{411,2684.880126,-2020.778686,13.110149,180.000000,-1,-1,0},
{481,2684.371093,-1989.574951,13.132552,180.000000,-1,-1,0},
{468,2639.946777,-2002.521362,13.133521,180.000000,-1,-1,0},
{463,2775.094482,-1932.982910,13.117671,180.000000,-1,-1,0},
{411,2862.818115,-1990.241821,10.513294,180.000000,-1,-1,0},
{402,2385.943847,-2159.845947,13.139410,180.000000,-1,-1,0},
{463,2340.735351,-2186.837402,13.125390,180.000000,-1,-1,0},
{439,2246.661132,-2157.667480,13.124773,180.000000,-1,-1,0},
{402,2729.363769,-1937.232299,13.124256,180.000000,-1,-1,0},
{475,2522.780761,-1898.065795,13.131587,180.000000,-1,-1,0},
{475,2455.118896,-1764.604858,13.159225,180.000000,-1,-1,0},
{402,2409.051757,-1721.201904,13.247529,180.000000,-1,-1,0},
{475,2370.479736,-1804.184082,13.134243,180.000000,-1,-1,0},
{506,2165.436767,-1690.054077,14.665163,180.000000,-1,-1,0},
{402,2187.606689,-1659.354492,14.660504,180.000000,-1,-1,0},
{439,2090.270263,-1568.542358,12.760601,180.000000,-1,-1,0},
{463,2120.618652,-1780.830810,12.962121,180.000000,-1,-1,0},
{468,2130.580322,-1489.684326,23.379762,180.000000,-1,-1,0},
{477,2217.533203,-1427.582763,23.393949,180.000000,-1,-1,0},
{420,2229.841308,-1348.387695,23.565059,180.000000,-1,-1,0},
{451,2276.082763,-1262.149902,23.559827,180.000000,-1,-1,0},
{402,2332.986083,-1237.600219,22.075338,180.000000,-1,-1,0},
{481,2365.635742,-1218.429321,27.173849,180.000000,-1,-1,0},
{451,2434.489501,-1243.278198,23.814294,180.000000,-1,-1,0},
{411,2428.002929,-1243.288574,23.753290,180.000000,-1,-1,0},
{429,2206.131347,-1153.733276,25.334329,180.000000,-1,-1,0},
{468,2147.852783,-1233.884033,23.754161,180.000000,-1,-1,0},
{477,2120.005371,-1134.849853,24.853433,180.000000,-1,-1,0},
{468,2060.900146,-1155.333862,23.453655,180.000000,-1,-1,0},
{463,2261.006835,-85.023330,26.082094,90.000000,-1,-1,0},
{468,2357.353027,-81.527709,26.091787,-90.000000,-1,-1,0},
{477,2470.346435,-39.229301,26.060791,-90.000000,-1,-1,0},
{439,2784.949951,67.212783,19.775896,-90.000000,-1,-1,0},
{429,2813.795166,-259.247009,9.968948,90.000000,-1,-1,0},
{477,2858.979736,-598.050292,10.736444,-90.000000,-1,-1,0},
{439,2542.827636,-967.216491,81.670036,90.000000,-1,-1,0},
{477,2365.089599,-651.510131,127.349990,90.000000,-1,-1,0},
{420,2251.613769,-370.349822,47.286125,-90.000000,-1,-1,0},
{506,2486.212402,-289.721557,16.677104,90.000000,-1,-1,0},
{411,2418.456054,336.990295,32.299751,90.000000,-1,-1,0},
{477,2443.252685,334.779693,32.098411,-90.000000,-1,-1,0},
{411,1751.646972,430.936950,18.413223,90.000000,-1,-1,0},
{463,1630.607055,266.472534,19.195158,-90.000000,-1,-1,0},
{506,1855.552856,735.765930,10.646944,90.000000,-1,-1,0},
{402,1946.487060,729.986267,10.399641,-90.000000,-1,-1,0},
{420,2200.993896,938.270874,10.401405,90.000000,-1,-1,0},
{439,-204.407211,2736.582031,62.280033,90.000000,-1,-1,0},
{429,2162.853515,1022.237121,10.394897,-90.000000,-1,-1,0},
{463,2390.257324,986.111694,10.404885,90.000000,-1,-1,0},
{400,2461.014648,918.929138,10.398962,-90.000000,-1,-1,0},
{411,2460.541748,928.215209,10.405200,-90.000000,-1,-1,0},
{463,2552.532958,1030.834716,10.404829,-90.000000,-1,-1,0},
{506,2513.765869,1125.029296,10.395085,-90.000000,-1,-1,0},
{477,2568.290527,1148.394653,10.400629,90.000000,-1,-1,0},
{420,2635.441650,1181.947998,10.399888,-90.000000,-1,-1,0},
{439,2510.143554,1206.751098,10.399824,90.000000,-1,-1,0},
{475,2500.591064,1211.734863,10.396327,-90.000000,-1,-1,0},
{468,2539.624511,1266.085449,10.404191,90.000000,-1,-1,0},
{439,2587.491210,1323.971435,10.403752,-90.000000,-1,-1,0},
{400,2766.139404,1281.726196,10.327919,90.000000,-1,-1,0},
{411,2764.036132,1268.799682,10.322216,-90.000000,-1,-1,0},
{451,2817.437988,1269.768676,10.325962,90.000000,-1,-1,0},
{439,2771.076660,1432.093872,10.049057,90.000000,-1,-1,0},
{506,2851.511718,1640.177246,10.401062,-90.000000,-1,-1,0},
{420,2852.668457,1659.488403,10.404685,-90.000000,-1,-1,0},
{411,2831.657958,2017.242919,10.402729,90.000000,-1,-1,0},
{481,2786.272705,2197.176757,10.399016,90.000000,-1,-1,0},
{468,2812.677978,2152.171875,10.397680,90.000000,-1,-1,0},
{506,2852.749755,2330.644531,10.396202,-90.000000,-1,-1,0},
{402,2841.514160,2364.178222,10.395376,-90.000000,-1,-1,0},
{400,2815.811279,2375.429443,10.398076,-90.000000,-1,-1,0},
{439,2512.255615,2398.089843,10.402235,-90.000000,-1,-1,0},
{400,2524.409423,2373.352539,3.783255,90.000000,-1,-1,0},
{451,2511.966308,2492.692382,10.401021,-90.000000,-1,-1,0},
{402,2509.688964,2533.406250,10.397439,-90.000000,-1,-1,0},
{475,2529.684326,2530.286865,21.454208,90.000000,-1,-1,0},
{420,2373.160400,2527.801269,10.401923,-90.000000,-1,-1,0},
{439,2164.715332,2490.427734,10.398900,-90.000000,-1,-1,0},
{402,2103.095214,2079.207275,10.403100,90.000000,-1,-1,0},
{400,-303.861816,2683.999755,62.228450,90.000000,-1,-1,0},
{411,1925.843017,1988.928955,7.172914,-90.000000,-1,-1,0},
{429,1913.304321,2021.858032,13.369249,-90.000000,-1,-1,0},
{463,1860.632934,2030.256835,13.361943,90.000000,-1,-1,0},
{477,1876.490478,1776.703979,12.327685,-90.000000,-1,-1,0},
{439,2172.140625,1669.028808,10.397164,-90.000000,-1,-1,0},
{477,2186.974853,1871.221313,10.399312,-90.000000,-1,-1,0},
{402,2386.932861,2004.638183,10.399436,-90.000000,-1,-1,0},
{402,2283.601318,2049.751220,10.399580,-90.000000,-1,-1,0},
{402,1179.078002,-1338.990356,13.861722,90.000000,-1,-1,0},
{429,1452.443847,-1155.537475,23.833950,90.000000,-1,-1,0},
{429,1620.374145,-1165.885498,24.078125,-90.000000,-1,-1,0},
{420,1739.998046,-1156.236083,23.828125,-90.000000,-1,-1,0},
{429,1681.197265,-1462.047241,13.546875,90.000000,-1,-1,0},
{475,1745.994140,-1454.572265,13.546875,-90.000000,-1,-1,0},
{411,1534.074584,-1846.399902,13.546875,0.000000,-1,-1,0},
{402,1630.676269,-1905.352661,13.551810,0.000000,-1,-1,0},
{468,1775.956787,-1933.347045,13.386354,0.000000,-1,-1,0},
{475,1809.991577,-2023.155273,13.542015,0.000000,-1,-1,0},
{429,1265.478271,-1361.004638,13.481266,0.000000,-1,-1,0},
{420,2172.737792,1997.229980,10.399847,-90.000000,-1,-1,0}
};

#endif

#if SAVE_VEHICLES_IN_DB

new vehcount;

new spoiler[20][0] = {
	{1000},
	{1001},
	{1002},
	{1003},
	{1014},
	{1015},
	{1016},
	{1023},
	{1058},
	{1060},
	{1049},
	{1050},
	{1138},
	{1139},
	{1146},
	{1147},
	{1158},
	{1162},
	{1163},
	{1164}
};

#endif

new nitro[3][0] = {
    {1008},
    {1009},
    {1010}
};

#if SAVE_VEHICLES_IN_DB

new fbumper[23][0] = {
    {1117},
    {1152},
    {1153},
    {1155},
    {1157},
    {1160},
    {1165},
    {1167},
    {1169},
    {1170},
    {1171},
    {1172},
    {1173},
    {1174},
    {1175},
    {1179},
    {1181},
    {1182},
    {1185},
    {1188},
    {1189},
    {1192},
    {1193}
};

new rbumper[22][0] = {
    {1140},
    {1141},
    {1148},
    {1149},
    {1150},
    {1151},
    {1154},
    {1156},
    {1159},
    {1161},
    {1166},
    {1168},
    {1176},
    {1177},
    {1178},
    {1180},
    {1183},
    {1184},
    {1186},
    {1187},
    {1190},
    {1191}
};

new exhaust[28][0] = {
    {1018},
    {1019},
    {1020},
    {1021},
    {1022},
    {1028},
    {1029},
    {1037},
    {1043},
    {1044},
    {1045},
    {1046},
    {1059},
    {1064},
    {1065},
    {1066},
    {1089},
    {1092},
    {1104},
    {1105},
    {1113},
    {1114},
    {1126},
    {1127},
    {1129},
    {1132},
    {1135},
    {1136}
};

new bventr[2][0] = {
    {1042},
    {1044}
};

new bventl[2][0] = {
    {1043},
    {1045}
};

new bscoop[4][0] = {
	{1004},
	{1005},
	{1011},
	{1012}
};

new rscoop[13][0] = {
    {1006},
    {1032},
    {1033},
    {1035},
    {1038},
    {1053},
    {1054},
    {1055},
    {1061},
    {1067},
    {1068},
    {1088},
    {1091}
};

new lskirt[21][0] = {
    {1007},
    {1026},
    {1031},
    {1036},
    {1039},
    {1042},
    {1047},
    {1048},
    {1056},
    {1057},
    {1069},
    {1070},
    {1090},
    {1093},
    {1106},
    {1108},
    {1118},
    {1119},
    {1133},
    {1122},
    {1134}
};

new rskirt[21][0] = {
    {1017},
    {1027},
    {1030},
    {1040},
    {1041},
    {1051},
    {1052},
    {1062},
    {1063},
    {1071},
    {1072},
    {1094},
    {1095},
    {1099},
    {1101},
    {1102},
    {1107},
    {1120},
    {1121},
    {1124},
    {1137}
};

new hydraulics[1][0] = {
    {1087}
};

new base[1][0] = {
    {1086}
};

new rbbars[2][0] = {
    {1109},
    {1110}
};

new fbbars[2][0] = {
    {1115},
    {1116}
};

new wheels[17][0] = {
    {1025},
    {1073},
    {1074},
    {1075},
    {1076},
    {1077},
    {1078},
    {1079},
    {1080},
    {1081},
    {1082},
    {1083},
    {1084},
    {1085},
    {1096},
    {1097},
    {1098}
};

new lights[2][0] = {
	{1013},
	{1024}
};

#endif

//--------------------------------------------------------------

forward Vehicles_OnGameModeInit();
forward VehiclesConfig();
forward Vehicles_OnPlayerEnterVehicle(playerid,vehicleid);
forward Vehicles_OnVehicleMod(vehicleid,componentid);
forward Vehicles_OnVehiclePaintjob(vehicleid,paintjobid);
forward Vehicles_OnVehicleRespray(vehicleid,color1,color2);
forward Vehicles_OnVehicleDeath(vehicleid, killerid);
forward Vehicles_OnPlayerExitVehicle(playerid, vehicleid);

new VehicleDB[MAX_STRING] = "MultiGTA/Vehicles/";

new VehicleSpawns_DB[MAX_STRING] = "MultiGTA/Main/VehicleSpawns.txt";

VehicleDataLoadAll()
{
    Debug("vehicles.inc > VehicleDataLoadAll - Start");
    
	new temp[MAX_STRING];
	if (!db_Exists(DatabaseDB))	db_Create(DatabaseDB);
	set(temp,db_Get(DatabaseDB,"Vehicle_DB"));
	if (strlen(temp) > 0) set(VehicleDB,temp);

	if (!db_Exists(VehicleDB))
	{
		VehicleDataSaveAll();
		return;
	}
	for (new i=0;i<VEHICLES_SIZE;i++)
	{
 		new vdbname[MAX_STRING];
 		format(vdbname,sizeof(vdbname),"%s%s.txt",VehicleDB,VehiclesInfo[i][vehicle_name]);
 		if (!db_Exists(vdbname))
 		{
 		    continue;
 		}
 		set(temp,db_Get(vdbname,"Name"));
 		if (strlen(temp) > 0) set(VehiclesInfo[i][vehicle_name],temp);
 		set(temp,nullstr);
 		set(temp,db_Get(vdbname,"Level"));
 		if (strlen(temp) > 0) VehiclesInfo[i][vehicle_level] = strval(temp);
 		set(temp,nullstr);
 		set(temp,db_Get(vdbname,"Cost"));
 		if (strlen(temp) > 0) VehiclesInfo[i][vehicle_cost] = strval(temp);
 		set(temp,nullstr);
	}
	WriteLog("Vehicles data Loaded!");
	Debug("vehicles.inc > VehicleDataLoadAll - Stop");
	return;
}

VehicleDataSaveAll()
{
	Debug("vehicles.inc > VehicleDataSaveAll - Start");
	new temp[MAX_STRING];
	if (db_Exists(DatabaseDB))
	{
		db_Set(DatabaseDB,"Vehicle_DB",VehicleDB);
 	}
	for (new i=0;i<VEHICLES_SIZE;i++)
	{
		new vdbname[MAX_STRING];
 		format(vdbname,sizeof(vdbname),"%s%s.txt",VehicleDB,VehiclesInfo[i][vehicle_name]);
		if (db_Exists(vdbname)) {
			continue;
		}
		db_Create(vdbname);
		db_BeforeBigSaving(vdbname);
 		db_Set(vdbname,"Name",VehiclesInfo[i][vehicle_name]);
		valstr(temp,VehiclesInfo[i][vehicle_level]);
 		db_Set(vdbname,"Level",temp);
		set(temp,nullstr);
		valstr(temp,VehiclesInfo[i][vehicle_cost]);
 		db_Set(vdbname,"Cost",temp);
		set(temp,nullstr);
		db_AfterBigSaving(vdbname);
	}
	WriteLog("All vehicles saved!");
	Debug("vehicles.inc > VehicleDataSaveAll - Stop");
	return;
}

public VehiclesConfig()
{
	Debug("vehicles.inc > VehiclesConfig - Start");
	
	if (!db_Exists(DatabaseDB)) db_Create(DatabaseDB);
	new temp[MAX_STRING];
	set(temp,db_Get(DatabaseDB,"VehicleSpawns_DB"));
	if (strlen(temp) > 0) set(VehicleSpawns_DB,temp); 
	else { set(temp,VehicleSpawns_DB); db_Set(DatabaseDB,"VehicleSpawns_DB",temp);  }
	set(temp,nullstr);
	if (!db_Exists(VehicleSpawns_DB)) return;
	Debug("vehicles.inc > VehiclesConfig - Stop");
	return;
}

//----------------------------------------------------------------
new ActiveVehicles[MAX_DEFAULT_VEHICLE_SPAWNS];
new ActiveVehiclesCount;

AddVehicleSpawn(Model,Float:X,Float:Y,Float:Z,Float:Heading,Colour1,Colour2)
{
	Debug("vehicles.inc > AddVehicleSpawn - Start");
	if (Model < 400 || Model > 611)
	{
    		WriteLog("Warning! Attemp to spawn unknown vehicle!");
		Debug("vehicles.inc > AddVehicleSpawn - Stop");
		return -1;
	}

	if (ActiveVehiclesCount >= MAX_DEFAULT_VEHICLE_SPAWNS)
	{
		new logstring[256];
		format(logstring, sizeof (logstring), "Warning! Vehicle limit reached. '%s' failed to spawn.",GetVehicleName(Model));
    		WriteLog(logstring);
		Debug("vehicles.inc > AddVehicleSpawn - Stop");
		return -1;
	}


	if ((ActiveVehicleModelCount(Model) == 0) && (ActiveVehicleModelsCount() >= MAX_VEHICLE_MODELS))
	{//if no vehicles of that model are already spawned && over 69 models already used
	// we will change the model to a random one we have already used
		new newmodel;
		new i;
		while ((i<5)&&(ActiveVehicleModelCount(newmodel) == 0))
		{ // we will find a model we have already used
		    i++;
    		newmodel = GetRndVModelByLevel(20); 
		}
		if (ActiveVehicleModelCount(newmodel)==0)
		{ // if we still failed to find a useable model, return
			
			new logstring[256];
			format(logstring, sizeof (logstring), "Error: '%s' failed to load.",GetVehicleName(Model));
    			WriteLog(logstring);
			Debug("vehicles.inc > AddVehicleSpawn - Stop");
			return -1;
		}
		
		new logstring[256];
		format(logstring, sizeof (logstring), "Warning! Vehicle models limit reached. '%s' changed to '%s'.",GetVehicleName(Model),GetVehicleName(newmodel));
    		WriteLog(logstring);
		Model = newmodel;
	}

	ActiveVehicles[ActiveVehiclesCount]=Model;
	ActiveVehiclesCount++;
 	new vid = AddStaticVehicle(Model,X,Y,Z,Heading,Colour1,Colour2);
    	new logstring[256];
	format(logstring, sizeof (logstring), "Vehicle: '%s' spawned.",GetVehicleName(Model));
    	WriteLog(logstring);
	Debug("vehicles.inc > AddVehicleSpawn - Stop");
	return vid;
}

ActiveVehicleModelCount(model)
{
	Debug("vehicles.inc > ActiveVehicleModelCount - Start");
	if (model < 400) return 0; // less than 400 is an invalid vehicle model
	new modelcount;
    	for (new i=0;i<sizeof(ActiveVehicles);i++)
    	{
    		if (ActiveVehicles[i] == model) modelcount++;
	}
	Debug("vehicles.inc > ActiveVehicleModelCount - Stop");
	return modelcount;
}

ActiveVehicleModelsCount()
{
	Debug("vehicles.inc > ActiveVehicleModelsCount - Start");
	new activemodels[VEHICLES_SIZE];
	new count;
	for (new i=0;i<ActiveVehiclesCount;i++)
 	{
 	    new model = ActiveVehicles[i];
 	    if (model < VEHICLES_START) continue;
 	    new luid=model-VEHICLES_START;
 		if (activemodels[luid] == 0)
 		{
			activemodels[luid]++;
			count++;
		}
 	}
	Debug("vehicles.inc > ActiveVehicleModelsCount - Stop");
 	return count;
}

GetVehicleName(vehiclemodel)
{
	Debug("vehicles.inc > GetVehicleName - Start");
	new VehicleName[MAX_STRING];
	for (new vlookupid=0;vlookupid<VEHICLES_SIZE;vlookupid++)
	{
	    new lookupmodel = VehiclesInfo[vlookupid][vehicle_model];
	    if (lookupmodel == vehiclemodel)
	    {
	        set(VehicleName,VehiclesInfo[vlookupid][vehicle_name]);
	        return VehicleName;
	    }
	}
	Debug("vehicles.inc > GetVehicleName - Stop");
	return VehicleName;
}

GetVehicleCost(vehiclemodel)
{
	new vehiclecost;
	for (new vlookupid=0;vlookupid<VEHICLES_SIZE;vlookupid++)
	{
	    new lookupmodel = VehiclesInfo[vlookupid][vehicle_model];
	    if (lookupmodel == vehiclemodel)
	    {
	        vehiclecost = VehiclesInfo[vlookupid][vehicle_cost];
	        return vehiclecost;
	    }
	}
	return vehiclecost;
}

GetVehicleSpeed(vehiclemodel)
{
	new vehiclespeed;
	for (new vlookupid=0;vlookupid<VEHICLES_SIZE;vlookupid++)
	{
	    new lookupmodel = VehiclesInfo[vlookupid][vehicle_model];
	    if (lookupmodel == vehiclemodel)
	    {
	        vehiclespeed = VehiclesInfo[vlookupid][vehicle_speed];
	        return vehiclespeed;
	    }
	}
	return vehiclespeed;
}

GetVehicleModelByName(vehiclename[])
{
	for (new vlookupid=0;vlookupid<VEHICLES_SIZE;vlookupid++)
	{
		new lookupname[MAX_STRING];
		set(lookupname,VehiclesInfo[vlookupid][vehicle_name]);
		if (strcomp(vehiclename,lookupname,true) == 1)
		{
		    return VehiclesInfo[vlookupid][vehicle_model];
		}
	}
	return -1;
}
#pragma unused GetVehicleModelByName

GetRndVModelByLevel(level)
{
	Debug("vehicles.inc > GetRndVModelByLevel- Start");
	new leveledvehicles[VEHICLES_SIZE+1];
	new idx=0;
	for (new vlookupid=0;vlookupid<VEHICLES_SIZE;vlookupid++)
	{
		if (VehiclesInfo[vlookupid][vehicle_level] == 0) continue;
	    if (VehiclesInfo[vlookupid][vehicle_level] <= level)
	    {
	    	leveledvehicles[idx] = VehiclesInfo[vlookupid][vehicle_model];
	    	idx++;
	    }
	}
	new rnd = random(idx);
	new vmodel;
	vmodel = leveledvehicles[rnd];
	Debug("vehicles.inc > GetRndVModelByLevel- Stop");
	return vmodel;
}

public Vehicles_OnGameModeInit(){
	VehiclesConfig();
	VehicleDataLoadAll();
	#if SAVE_VEHICLES_IN_DB
	vehcount=CountVehicles();
	LoadVehicles();
 	for(new c=1;c<=vehcount;c++)
	{
	 	ModVehicle(c);
	}
	SaveVehicles();
	TimerVehicles = SetTimer("SaveVehicles",120000,1); //2 mins
	#else
	new vehid;
	for (new i=0;i<sizeof(VehiclesNotFileSpawns);i++)
	{
		if (VehiclesNotFileSpawns[i][vspawn_model] != 0)
		{
			vehid = AddVehicleSpawn(VehiclesNotFileSpawns[i][vspawn_model],VehiclesNotFileSpawns[i][vspawn_x],VehiclesNotFileSpawns[i][vspawn_y],VehiclesNotFileSpawns[i][vspawn_z],VehiclesNotFileSpawns[i][vspawn_heading],VehiclesNotFileSpawns[i][vspawn_colour1],VehiclesNotFileSpawns[i][vspawn_colour2]);
			if (VehiclesNotFileSpawns[i][vspawn_interior] != 0 && vehid != -1) LinkVehicleToInterior(vehid,VehiclesNotFileSpawns[i][vspawn_interior]);
		}
	}
	new logstring[256];
	format(logstring,sizeof(logstring),"Spawned %d vehicles. Models used: %d.",ActiveVehiclesCount,ActiveVehicleModelsCount());
	WriteLog(logstring);
	#endif
	return 0;
}

#if SAVE_VEHICLES_IN_DB

stock LoadVehicles()
{
	Debug("vehicles.inc > LoadVehicles- Start");
	new filestring[256];
	new File: file = fopen(VehicleSpawns_DB, io_read);
	new model,color1,color2,Float:spawnx,Float:spawny,Float:spawnz,Float:spawnhead;
	if (file)
	{
	    	for(new vehicleid = 1;vehicleid<=vehcount;vehicleid++)
		{
		    	fread(file, filestring);
			StripNewLine(filestring);
			if (strlen(filestring) == 0) return;
			if (strfind(filestring, "//",true) != -1) continue;
			split(filestring, SplitDiv, ',');
			VehicleDBInfo[vehicleid][modeldb] = model = strval(SplitDiv[0]);
			VehicleDBInfo[vehicleid][x_spawn] = spawnx = floatstr(SplitDiv[1]);
			VehicleDBInfo[vehicleid][y_spawn] = spawny = floatstr(SplitDiv[2]);
			VehicleDBInfo[vehicleid][z_spawn] = spawnz = floatstr(SplitDiv[3]);
			VehicleDBInfo[vehicleid][za_spawn] = spawnhead = floatstr(SplitDiv[4]);
			VehicleDBInfo[vehicleid][color_1] = color1 = strval(SplitDiv[5]);
			VehicleDBInfo[vehicleid][color_2] = color2 = strval(SplitDiv[6]);
			VehicleDBInfo[vehicleid][mod1] = strval(SplitDiv[7]);
			VehicleDBInfo[vehicleid][mod2] = strval(SplitDiv[8]);
			VehicleDBInfo[vehicleid][mod3] = strval(SplitDiv[9]);
			VehicleDBInfo[vehicleid][mod4] = strval(SplitDiv[10]);
			VehicleDBInfo[vehicleid][mod5] = strval(SplitDiv[11]);
			VehicleDBInfo[vehicleid][mod6] = strval(SplitDiv[12]);
			VehicleDBInfo[vehicleid][mod7] = strval(SplitDiv[13]);
			VehicleDBInfo[vehicleid][mod8] = strval(SplitDiv[14]);
			VehicleDBInfo[vehicleid][mod9] = strval(SplitDiv[15]);
			VehicleDBInfo[vehicleid][mod10] = strval(SplitDiv[16]);
			VehicleDBInfo[vehicleid][mod11] = strval(SplitDiv[17]);
			VehicleDBInfo[vehicleid][mod12] = strval(SplitDiv[18]);
			VehicleDBInfo[vehicleid][mod13] = strval(SplitDiv[19]);
			VehicleDBInfo[vehicleid][mod14] = strval(SplitDiv[20]);
			VehicleDBInfo[vehicleid][mod15] = strval(SplitDiv[21]);
			VehicleDBInfo[vehicleid][mod16] = strval(SplitDiv[22]);
			VehicleDBInfo[vehicleid][mod17] = strval(SplitDiv[23]);
			VehicleDBInfo[vehicleid][paintjob] = strval(SplitDiv[24]);
			VehicleDBInfo[vehicleid][interiorid] = strval(SplitDiv[25]);
			if (model != 0)
			{
				new veh = AddVehicleSpawn(model,spawnx,spawny,spawnz,spawnhead,color1,color2);
				if (VehicleDBInfo[vehicleid][interiorid] != 0 && veh != -1) LinkVehicleToInterior(veh,VehicleDBInfo[vehicleid][interiorid]);
			}
		}
	}
	fclose(file);
	new logstring[256];
	format(logstring,sizeof(logstring),"Spawned %d vehicles from DB. Models used: %d.",ActiveVehiclesCount,ActiveVehicleModelsCount());
	WriteLog(logstring);
	Debug("vehicles.inc > LoadVehicles - Stop");
}

forward SaveVehicles();
public SaveVehicles()
{
	Debug("vehicles.inc > SaveVehicles- Start");
	new filestring[256];
	new File: vfile = fopen(VehicleSpawns_DB, io_write);
	for(new vehicleid = 1;vehicleid<=vehcount;vehicleid++)
     	{
		format(filestring, sizeof(filestring), "%d,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r\n",
		VehicleDBInfo[vehicleid][modeldb],
		VehicleDBInfo[vehicleid][x_spawn],
		VehicleDBInfo[vehicleid][y_spawn],
		VehicleDBInfo[vehicleid][z_spawn],
		VehicleDBInfo[vehicleid][za_spawn],
		VehicleDBInfo[vehicleid][color_1],
		VehicleDBInfo[vehicleid][color_2],
		VehicleDBInfo[vehicleid][mod1],
		VehicleDBInfo[vehicleid][mod2],
		VehicleDBInfo[vehicleid][mod3],
		VehicleDBInfo[vehicleid][mod4],
		VehicleDBInfo[vehicleid][mod5],
		VehicleDBInfo[vehicleid][mod6],
		VehicleDBInfo[vehicleid][mod7],
		VehicleDBInfo[vehicleid][mod8],
		VehicleDBInfo[vehicleid][mod9],
		VehicleDBInfo[vehicleid][mod10],
		VehicleDBInfo[vehicleid][mod11],
		VehicleDBInfo[vehicleid][mod12],
		VehicleDBInfo[vehicleid][mod13],
		VehicleDBInfo[vehicleid][mod14],
		VehicleDBInfo[vehicleid][mod15],
		VehicleDBInfo[vehicleid][mod16],
		VehicleDBInfo[vehicleid][mod17],
		VehicleDBInfo[vehicleid][paintjob],
		VehicleDBInfo[vehicleid][interiorid]
		);
		fwrite(vfile, filestring);
	}
	fclose(vfile);
	WriteLog("All vehicles saved in DB");
	Debug("vehicles.inc > SaveVehicles - Stop");
}

stock CountVehicles() {
	Debug("vehicles.inc > CountVehicles- Start");
	new File:VehicleFile;
	new blank[256];
	new count = 0;
	if (fexist(VehicleSpawns_DB)) {
		VehicleFile = fopen(VehicleSpawns_DB);
		while(fread(VehicleFile, blank, sizeof blank)) {
			count++;
		}
		fclose(VehicleFile);
	} else {
		count = -1;
	}
	if (count >= MAX_DEFAULT_VEHICLE_SPAWNS) count = MAX_DEFAULT_VEHICLE_SPAWNS;
	Debug("vehicles.inc > CountVehicles- Stop");
	return count;
}

#endif

public Vehicles_OnVehicleMod(vehicleid,componentid)
{
				#if SAVE_VEHICLES_IN_DB
				for(new s=0; s<20; s++) {
     				if(componentid == spoiler[s][0]) {
       					VehicleDBInfo[vehicleid][mod1] = componentid;
   	        		}
				}
				#endif
				for(new s=0; s<3; s++) {
     				if(componentid == nitro[s][0]) {
					#if defined VEHICLE_SAVE_IN_DB
       					VehicleDBInfo[vehicleid][mod2] = componentid;
					#endif
					CarHaveNOS[vehicleid] = true;
   	        		}
				}
				#if SAVE_VEHICLES_IN_DB
				for(new s=0; s<23; s++) {
     				if(componentid == fbumper[s][0]) {
       					VehicleDBInfo[vehicleid][mod3] = componentid;
   	        		}
				}
				for(new s=0; s<22; s++) {
     				if(componentid == rbumper[s][0]) {
       					VehicleDBInfo[vehicleid][mod4] = componentid;
   	        		}
				}
				for(new s=0; s<28; s++) {
     				if(componentid == exhaust[s][0]) {
       					VehicleDBInfo[vehicleid][mod5] = componentid;
   	        		}
				}
				for(new s=0; s<2; s++) {
     				if(componentid == bventr[s][0]) {
       					VehicleDBInfo[vehicleid][mod6] = componentid;
   	        		}
				}
				for(new s=0; s<2; s++) {
     				if(componentid == bventl[s][0]) {
       					VehicleDBInfo[vehicleid][mod7] = componentid;
   	        		}
				}
				for(new s=0; s<4; s++) {
     				if(componentid == bscoop[s][0]) {
       					VehicleDBInfo[vehicleid][mod8] = componentid;
   	        		}
				}
				for(new s=0; s<13; s++) {
     				if(componentid == rscoop[s][0]) {
       					VehicleDBInfo[vehicleid][mod9] = componentid;
   	        		}
				}
				for(new s=0; s<21; s++) {
     				if(componentid == lskirt[s][0]) {
       					VehicleDBInfo[vehicleid][mod10] = componentid;
   	        		}
				}
				for(new s=0; s<21; s++) {
     				if(componentid == rskirt[s][0]) {
       					VehicleDBInfo[vehicleid][mod11] = componentid;
   	        		}
				}
				for(new s=0; s<1; s++) {
     				if(componentid == hydraulics[s][0]) {
       					VehicleDBInfo[vehicleid][mod12] = componentid;
   	        		}
				}
				for(new s=0; s<1; s++) {
     				if(componentid == base[s][0]) {
       					VehicleDBInfo[vehicleid][mod13] = componentid;
   	        		}
				}
				for(new s=0; s<2; s++) {
     				if(componentid == rbbars[s][0]) {
       					VehicleDBInfo[vehicleid][mod14] = componentid;
   	        		}
				}
				for(new s=0; s<2; s++) {
     				if(componentid == fbbars[s][0]) {
       					VehicleDBInfo[vehicleid][mod15] = componentid;
   	        		}
				}
				for(new s=0; s<17; s++) {
     				if(componentid == wheels[s][0]) {
       					VehicleDBInfo[vehicleid][mod16] = componentid;
   	        		}
				}
				for(new s=0; s<2; s++) {
     				if(componentid == lights[s][0]) {
       					VehicleDBInfo[vehicleid][mod17] = componentid;
   	        		}
				}
				#endif
				return 0;
}

public Vehicles_OnVehiclePaintjob(vehicleid,paintjobid)
{
	#if SAVE_VEHICLES_IN_DB
	VehicleDBInfo[vehicleid][paintjob] = paintjobid;
	#endif
	return 0;
}

public Vehicles_OnVehicleRespray(vehicleid,color1,color2)
{
	#if SAVE_VEHICLES_IN_DB
	VehicleDBInfo[vehicleid][color_1] = color1;
	VehicleDBInfo[vehicleid][color_2] = color2;
	#endif
	return 0;
}

#if SAVE_VEHICLES_IN_DB

stock ModVehicle(vehicleid)
{
	if(VehicleDBInfo[vehicleid][mod1] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod1]);
	}
	if(VehicleDBInfo[vehicleid][mod2] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod2]);
	}
	if(VehicleDBInfo[vehicleid][mod3] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod3]);
	}
	if(VehicleDBInfo[vehicleid][mod4] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod4]);
	}
	if(VehicleDBInfo[vehicleid][mod5] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod5]);
	}
	if(VehicleDBInfo[vehicleid][mod6] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod6]);
	}
	if(VehicleDBInfo[vehicleid][mod7] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod7]);
	}
	if(VehicleDBInfo[vehicleid][mod8] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod8]);
 	}
	if(VehicleDBInfo[vehicleid][mod9] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod9]);
	}
	if(VehicleDBInfo[vehicleid][mod10] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod10]);
	}
	if(VehicleDBInfo[vehicleid][mod11] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod11]);
	}
	if(VehicleDBInfo[vehicleid][mod12] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod12]);
	}
	if(VehicleDBInfo[vehicleid][mod13] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod13]);
	}
	if(VehicleDBInfo[vehicleid][mod14] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod14]);
	}
	if(VehicleDBInfo[vehicleid][mod15] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod15]);
	}
	if(VehicleDBInfo[vehicleid][mod16] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod16]);
	}
	if(VehicleDBInfo[vehicleid][mod17] != 0) {
		AddVehicleComponent(vehicleid,VehicleDBInfo[vehicleid][mod17]);
	}
	if(VehicleDBInfo[vehicleid][color_1] > -1 || VehicleDBInfo[vehicleid][color_2] > -1) {
		ChangeVehicleColor(vehicleid,VehicleDBInfo[vehicleid][color_1],VehicleDBInfo[vehicleid][color_2]);
 	}
	if(VehicleDBInfo[vehicleid][paintjob] > -1) {
		ChangeVehiclePaintjob(vehicleid,VehicleDBInfo[vehicleid][paintjob]);
 	}
}
#endif

public Vehicles_OnVehicleDeath(vehicleid, killerid){
	#pragma unused killerid
	#if SAVE_VEHICLES_IN_DB
	VehicleDBInfo[vehicleid][mod1] = 0;
	VehicleDBInfo[vehicleid][mod2] = 0;
	VehicleDBInfo[vehicleid][mod3] = 0;
	VehicleDBInfo[vehicleid][mod4] = 0;
	VehicleDBInfo[vehicleid][mod5] = 0;
	VehicleDBInfo[vehicleid][mod6] = 0;
	VehicleDBInfo[vehicleid][mod7] = 0;
	VehicleDBInfo[vehicleid][mod8] = 0;
	VehicleDBInfo[vehicleid][mod9] = 0;
	VehicleDBInfo[vehicleid][mod10] = 0;
	VehicleDBInfo[vehicleid][mod11] = 0;
	VehicleDBInfo[vehicleid][mod12] = 0;
	VehicleDBInfo[vehicleid][mod13] = 0;
	VehicleDBInfo[vehicleid][mod14] = 0;
	VehicleDBInfo[vehicleid][mod15] = 0;
	VehicleDBInfo[vehicleid][mod16] = 0;
	VehicleDBInfo[vehicleid][mod17] = 0;
	VehicleDBInfo[vehicleid][paintjob] = -1;
	#endif
	CarHaveNOS[vehicleid] = false;
	return 0;
}

public Vehicles_OnPlayerEnterVehicle(playerid,vehicleid){
	if (Show_Vehicles_Names == 0) return 0;
	new string[MAX_STRING];
	format(string,sizeof(string),"%s",GetVehicleName(GetVehicleModel(GetPlayerVehicleID(playerid))));
	ShowTextForPlayer(playerid, string,3000,1);
	return 0;
}

public Vehicles_OnPlayerExitVehicle(playerid, vehicleid)
{
	Debug("vehicles.inc > Vehicles_OnPlayerExitVehicle - Start");
	#if SAVE_VEHICLES_IN_DB
	if (vehicleid > ActiveVehiclesCount) return 0;
	if (CanVehicleFly(GetVehicleModel(vehicleid))) return 0;
	if (IsVehicleBoat(GetVehicleModel(vehicleid))) return 0;
	new Float:a,Float:x,Float:y,Float:z;
	GetVehicleZAngle(vehicleid,a);
	GetVehiclePos(vehicleid,x,y,z);
	VehicleDBInfo[vehicleid][x_spawn] = x;
	VehicleDBInfo[vehicleid][y_spawn] = y;
	VehicleDBInfo[vehicleid][z_spawn] = z;
	VehicleDBInfo[vehicleid][za_spawn] = a;
	VehicleDBInfo[vehicleid][interiorid] = GetPlayerInterior(playerid);
	#endif
	Debug("vehicles.inc > Vehicles_OnPlayerExitVehicle - Stop");
	return 0;
}

CanVehicleFly(model)
{
	new heli[10] = {V_LEVIATHN, V_HUNTER, V_SEASPAR, V_RCRAIDER, V_SPARROW, V_MAVERICK, V_VCNMAV, V_POLMAV, V_CARGOBOB, V_RAINDANC};
	for(new i=0; i < 10; i++) if(model == heli[i]) return 1;
	new plane[12] = {V_SKIMMER, V_RCBARON, V_RUSTLER, V_BEAGLE, V_CROPDUST, V_STUNT, V_SHAMAL, V_HYDRA, V_NEVADA, V_AT400, V_ANDROM, V_DODO};
    	for(new i=0; i < 12; i++) if(model == plane[i]) return 1;
	return 0;
}

IsVehicleBoat(model)
{
	new boat[10] = {V_PREDATOR, V_SQUALO, V_SPEEDER, V_REEFER, V_TROPIC, V_COASTG, V_DINGHY, V_MARQUIS, V_JETMAX, V_LAUNCH};
	for(new i=0; i < 10; i++) if(model == boat[i]) return 1;
	return 0;
}

IsVehicleMotoBike(model)
{
	new motobike[10] = {V_FAGGIO, V_BF400, V_COPBIKE, V_FCR900, V_FREEWAY, V_NRG500, V_PCJ600, V_QUAD, V_SANCHEZ, V_WAYFARER};
	for(new i=0; i < 10; i++) if(model == motobike[i]) return 1;
	return 0;
}